Skip to content

Instantly share code, notes, and snippets.

@jk0
Created August 20, 2015 18:17
Show Gist options
  • Save jk0/934650d4efdd891f111f to your computer and use it in GitHub Desktop.
Save jk0/934650d4efdd891f111f to your computer and use it in GitHub Desktop.
Copy password from keychain to clipboard
#!/bin/bash
PASSWORD=$(security 2>&1 >/dev/null find-generic-password -ga global:<name> | cut -c12-)
export PASSWORD=${PASSWORD%?}
echo $PASSWORD | tr -d "\n"| pbcopy && pbpaste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment