funtoo / keychain

keychain ssh-agent front-end
http://www.funtoo.org
GNU General Public License v2.0
750 stars 105 forks source link

/usr/bin/keychain: [[: not found #95

Closed soulawaker closed 6 years ago

soulawaker commented 6 years ago

I've installed version 2.8.1 from Ubuntu 16.04 apt. Then I've tried following code in my .zshrc.

# keychain directory
[ -z "$HOSTNAME" ] && HOSTNAME=`uname -n`
[ -f $HOME/.keychain/$HOSTNAME-sh ] && \
. $HOME/.keychain/$HOSTNAME-sh

# keychain setting
eval `keychain --eval --confhost --agents ssh`

Then following error occurred when sourcing it.

/usr/bin/keychain: 1137: /usr/bin/keychain: [[: not found
/usr/bin/keychain: 1140: /usr/bin/keychain: [[: not found
/usr/bin/keychain: 1137: /usr/bin/keychain: [[: not found
/usr/bin/keychain: 1140: /usr/bin/keychain: [[: not found
...
(same message repeated)
ghost commented 6 years ago

Thanks for the report. This is due to the use of [[ at the time which is bash specific. It has been fixed in later versions so you will need to either upgrade to a newer one or backport the changes

soulawaker commented 6 years ago

Ok. I will install latest version manually because it does not exist in Ubuntu repo. I think I need to replace only latest keychain and keychain.1 to each original path. Is it right?

soulawaker commented 6 years ago

Never mind. I found what I need.