Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command line access to keychain




Thanks. This appears to work OK for displaying items from the command line.
Unfortunately it always sends it's output to stderr which makes it harder to
catch the output and extract the actual password text from it. Grrrr.

Not hard; just redirect stderr to stdout. (I'm not sure why it does this either; will try to find out.)


security find-generic-password -a thecloud -g 2>&1


A little post-processing with sed or awk could then be used to extract the password:


security find-generic-password -a thecloud -g 2>&1 | grep password | sed -e "s/password: \"//" -e "s/\"//"


AppleScript may be a workable alternative as it looks like it might be
easier to get ahold of the actual password text.

Scott


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/apple-cdsa/email@hidden

This email sent to email@hidden
References: 
 >Re: Command line access to keychain (From: "Scott Thompson" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.