|
| On 4 Dez., 01:52, Generic Usenet Account <use...@sta.samsung.com>
wrote:
> On Nov 29, 7:38 pm, use...@sta.samsung.com wrote:
>
>
>
>
> The only thing that I can get to work is the following:
>
> presidents[0]=Washington
> presidents[1]=Adams
> presidents[2]=Jefferson
> presidents[3]=Madison
> presidents[4]=Monroe
> presidents[5]=Qunicy-Adams
> presidents[6]=Jackson
>
> echo ${presidents[0]} ${presidents[3]}
> ##### Could not find the KSH equivalent for echo
> $presidents[4-7]
>
> echo ${#presidents[*]}
>
> Is there some way to print a range of array elements?
See my reply upthread...
In ksh93, bash, ... (otherwise use the 'set - ...' approach)
echo ${presidents[@]:1:1} ${presidents[@]:4:4}
The second second number defines the number of elements (if omitted
until the end of the array list)... ${arrayvar[@]:index:length}
Janis
> Thanks
>
> [Courtesy:http://www.livefirelabs.com/unix_ti...ov_2003/1110...
>
> http://www.livefirelabs.com/unix_ti...ov_2003/1117...]
|
|