Skip to content

Instantly share code, notes, and snippets.

View rezlam's full-sized avatar

Gabriel Lamounier rezlam

  • Araxá, MG, Brazil
View GitHub Profile
@rezlam
rezlam / ssh-agent
Created March 2, 2011 12:29
Put this code in .bashrc or .profile to start ssh-agent automatically (tested with Git Bash on Windows 7).
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
echo succeeded
chmod 600 "$SSH_ENV"
. "$SSH_ENV" > /dev/null
~/test$ cat test.sh
#!/bin/sh
param1=\'$1\'
param2="'$1'"
echo \'$1\'
echo $param1
echo $param2
~/test$ ./test.sh 'require "irb"'