Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

simplify keychain access example #119

Merged
merged 1 commit into from

3 participants

@dlo

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

@indirect
Collaborator

Cool, thanks.

@indirect indirect merged commit 48262f5 into from
@mhfs

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.

@dlo
@mhfs

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?

@dlo

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
View
2  README.markdown
@@ -80,7 +80,7 @@ password from an item named "github.password" on the Mac OS
Keychain:
```bash
-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'
```
Defaults
Something went wrong with that request. Please try again.