[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] What is the best way to push back an element to address@
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] What is the best way to push back an element to address@hidden |
Date: |
Mon, 18 Apr 2016 08:09:55 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, Apr 17, 2016 at 09:49:28AM -0500, Peng Yu wrote:
> Obviously, way 1 is faster,
Then use this way.
> Way 2 is much slower, because I understand that the time to add an
> element to $@ will increase as the size of $@ increases.
The only time you should be manipulating $@ via set -- is when you are
writing for sh, rather than for bash. sh does not have arrays. It
*only* has address@hidden So all of the trickery involving $@ is just to work
around the lack of arrays in the inferior sh programming language.