From 44862ec8f8b08104f56a948196ef08650acbcfdf Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 7 Jul 2016 02:42:03 +0300 Subject: spawn_ssh_agent: command instead of which --- .bash_profile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.bash_profile b/.bash_profile index 2732697..f33ed86 100644 --- a/.bash_profile +++ b/.bash_profile @@ -45,15 +45,14 @@ fi spawn_ssh_agent() { if [ -z "${SSH_AGENT_PID:+x}" -o -z "${SSH_AUTH_SOCK:+x}" ]; then - local ssh_agent - ssh_agent="$( which ssh-agent 2> /dev/null )" || return $? + local ssh_agent="$( command -v ssh-agent )" || return $? eval "$( "$ssh_agent" -s )" > /dev/null || return $? trap "kill $SSH_AGENT_PID" 0 ssh-add || return $? fi } -if [ "$( uname -o )" == "Cygwin" ]; then +if [ "$( uname -o )" == 'Cygwin' ]; then spawn_ssh_agent fi -- cgit v1.2.3