Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to pull a password from Keychain to use in a script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to pull a password from Keychain to use in a script
Authored by: sr105 on Jul 25, '13 04:48:01PM

Your command could be simplified to:
security ... | sed -En '/^password: / s,^password: "(.*)"$,\1,p'

# No if() required:
mkdir -p $HOME/Data

Update: or as martin suggested, use -w with security.

Edited on Jul 25, '13 04:51:37PM by sr105



[ Reply to This | # ]