bug-bash
[Top][All Lists]
Advanced

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

Re: passing array to command line argument.


From: Chet Ramey
Subject: Re: passing array to command line argument.
Date: Tue, 09 Dec 2008 09:38:09 -0500
User-agent: Thunderbird 2.0.0.18 (Macintosh/20081105)

Dolphin06 wrote:
> Hello,
> So how can i pass the entire array, i m new to shell scripting so i do not
> really understand when you talk about unsubscripted word expansion

Since programs only take a list of strings as arguments, you have to expand
the array to a list of values.  The "${array[@]}" expansion can do that.
Expanding an array variable without using a subscript (${array} as opposed
to ${array[subscript]}) expands to the first element.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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