Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


simplify keychain access example #119

merged 1 commit into from

3 participants


There's no need for ruby execution--security has a flag to output the password only (-w).


Cool, thanks.

@indirect indirect merged commit 48262f5 into from

hey guys, just a heads up that the command proposed by @dlo is not working for me on mountain lion. the original one works well.


weird. I couldn't find a version number for the security command.

here's what's happening:

➜  security 2>&1 >/dev/null find-generic-password -gs github.password   
password: "---edited---"
➜  security 2>&1 >/dev/null find-generic-password -gs github.password -w

maybe something to do with -w directing to stdout that's being directed to /dev/null?


You know, that's definitely the problem. Taking out the >/dev/null will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 10, 2012
  1. @dlo

    simplify keychain access example

    dlo authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  README.markdown
2  README.markdown
@@ -80,7 +80,7 @@ password from an item named "github.password" on the Mac OS
-password = !security 2>&1 >/dev/null find-generic-password -gs github.password | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
+password = !security 2>&1 >/dev/null find-generic-password -gs github.password -w | tr -d '\n'
Something went wrong with that request. Please try again.