Get password from keychain (OSX)


/ Published in: Bash
Save to your folder(s)

Get password from keychain (OSX)


Copy this code and paste it in your HTML
  1. get_pw () {
  2. security 2>&1 >/dev/null find-generic-password -ga $USER
  3. |ruby -e 'print $1 if STDIN.gets =~ /^password: "(.*)"$/'
  4. }

URL: http://hints.macworld.com/article.php?story=20130722033452283

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.