Re: Expansion of unquoted special parameter $@ when used as the word for
From:
Andreas Kusalananda Kähäri
Subject:
Re: Expansion of unquoted special parameter $@ when used as the word for a HERE STRING
Date:
Tue, 5 Nov 2019 23:06:04 +0100
User-agent:
Mutt/1.12.2 (2019-09-21)
On Wed, Nov 06, 2019 at 08:28:49AM +1100, G. Branden Robinson wrote:
> At 2019-11-05T10:30:39-1000, Robin A. Meade wrote:
> > Consider:
> >
> > set a 'b c'
> > cat <<< $@;
> >
> > The output is:
> >
> > a b c
> >
> > I expected the 3 spaces between b and c to be preserved.
>
> You've got to double-quote $@ for it to work the way you desire:
>
> cat <<< "$@"
>
> Without quoting, $@ works like $*.
... but only if $IFS has a space as its first character.