[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation for a="$@"

From: Chet Ramey
Subject: Re: Documentation for a="$@"
Date: Sat, 19 May 2018 21:58:20 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 5/19/18 3:40 PM, Ilkka Virta wrote:
> In Bash, using "$@" in an assignment, (as in  a="$@" ) concatenates the
> positional parameters to single string, joined with spaces. Somewhat
> similarly to what "$*" does, except that $* uses the first letter of IFS,
> but $@ always uses a space.

The key is word splitting, not assignment in particular.  The shell uses
spaces to separate the positional parameters if the word is not going to
be split. I will add somethng to describe that.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]