Re: [dev] ssh-agent stanza in POSIX shell

From: Martin Kopta <martin_AT_kopta.eu>
Date: Sun, 30 Oct 2011 20:22:10 +0100

Reminds me http://www.ioccc.org :-)

On 10/30/2011 08:04 PM, Sime Ramov wrote:
> I've found the following clever ssh-agent stanza in Richard Crowley's
> `.profile`[https://raw.github.com/rcrowley/home/master/.profile]:
>
> which ssh-agent>/dev/null&& {
> : ${SSH_AUTH_SOCK:=$(echo /tmp/ssh-*/agent.* | cut -d" " -f1)}
> [ -S "$SSH_AUTH_SOCK" ]&& {
> export SSH_AUTH_SOCK
> } || {
> eval $(ssh-agent)
> ssh-add
> }
> }
>
> Wondering why it doesn't work properly in OpenBSD ksh as I am not so
> good with POSIX sh.
>
> It works partially, i.e. it spawns a new agent on every shell
> invocation.
>
Received on Sun Oct 30 2011 - 20:22:10 CET

This archive was generated by hypermail 2.3.0 : Sun Oct 30 2011 - 20:24:03 CET