ssh argv[0] support

Richard Kettlewell rjk+news at sfere.greenend.org.uk
Fri Sep 14 22:30:37 EST 2001


Jonathan Amery <jdamery at pick.ucam.org> writes:

> #! /bin/sh -e
> if [ "${0##*/}" == "ssh-argv0" ]
> then
>   echo 'ssh-argv0: This script should not be run like this, see
> ssh-argv0(1) for details' 1>&2;
>   exit 1;
> fi
> ssh "${0##*/}" "$@"

What's wrong using with shell aliases to achieve the same effect?

In fact I think shell aliases are actually better.  For example, using
bash alias syntax:

  alias pick="ssh jdamery at pick.ucam.org"

would work even when ucam.org wasn't in the DNS search list or when
your local username wasn't jdamery, situations in which just linking
~/bin/pick to your proposed ssh-argv0 would fail.

(You could link ~/bin/jdamery at pick.ucam.org to it instead, but that
would result in more typing.)

-- 
http://www.greenend.org.uk/rjk/



More information about the openssh-unix-dev mailing list