[squeak-dev] script arguments with spaces

K. K. Subramaniam kksubbu.ml at gmail.com
Sun Oct 10 14:24:56 UTC 2010


On Saturday 09 Oct 2010 10:39:16 am Eliot Miranda wrote:
> > ‌$@ always uses space as word separator while $* uses the first letter of
> > IFS
> > variable. Otherwise they are the same.‌ Smalltalk uses spaces for
> > separator so
> > $@ will do.
> 
> No.  $@ expands to the argument list as supplied to the current command:
My statement was ambiguous. Your clarification and example is much clearer, as 
the following reveals:
$ IFS=: wrapper "hello world" hello world
<snip>
"$*"
    hello world:hello:world
<snip>
"$@"
    hello world
    hello
    world

For programs which use : as word separator, "$*" will pass all its arguments 
as a *single argument* separated by colon so that the program itself can split 
them into separate arguments. For programs like squeakvm that don't have 
argument parsers "$@" will pass them as space-separated *arguments*. In both 
cases, spaces within arguments enclosed by quotes will be preserved.

Thanks .. Subbu



More information about the Squeak-dev mailing list