Created
February 2, 2014 16:41
-
-
Save alexwright/8771149 to your computer and use it in GitHub Desktop.
Find the most recently created ssh-agent socket and export it to the current session.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -user `whoami` -name agent\* -printf '%T@ %p\n' | sort -k 1nr | sed 's/^[^ ]* //' | head -n 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment