[erlang-questions] Re: how do I get the actual list of arguments passed to an escript?

Per Hedeland per@REDACTED
Tue Apr 5 21:46:40 CEST 2011

Per Melin <per.melin@REDACTED> wrote:
>On Tue, Apr 5, 2011 at 4:45 PM, Raimo Niskanen
><raimo+erlang-questions@REDACTED> wrote:
>> What you acually want is ${1+"@"} since "$@" when there are no arguments
>> expands to "" i.e one empty argument. ${1+"$@"} expands "$@" iff
>> there is at least one argument, empty or not.
>I've wondered about that. My manpage for bash says: 'When there are no
>positional parameters, "$@" and $@ expand to nothing (i.e., they are
>And I think it's been like that for quite some time. In which shell is
>${1+"@"} required?

One that is so old that it has this particular bug, which in all
likelihood means that you'll have a very hard time finding it these
days. I just now tried the Solaris (10) /bin/sh which doesn't seem to
have gotten any updates in the last 25 years or so - and it does do the
right thing with "$@".

--Per Hedeland

More information about the erlang-questions mailing list