Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14112

Re: Documentation for a="$@"

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Documentation for a="$@"
Date 2018-05-19 21:58 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.100.1526781523.1292.bug-bash@gnu.org> (permalink)
References <4704ad0f-5e0e-9606-2068-37f35a2c49dd@iki.fi>

Show all headers | View raw


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    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Documentation for a="$@" Chet Ramey <chet.ramey@case.edu> - 2018-05-19 21:58 -0400

csiph-web