| Generic Usenet Account 2007-12-03, 7:25 pm |
| On Nov 29, 7:38 pm, use...@sta.samsung.com wrote:
> Kindly suggest the ksh equivalent of the following csh script snippet
>
> ##############################
> set presidents=(Washington Adams Jefferson Madison Monroe Qunicy-Adams
> Jackson)
>
> echo $presidents[1] $presidents[4-7]
> ##############################
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?
Thanks
[Courtesy: http://www.livefirelabs.com/unix_ti...03/11102003.htm
http://www.livefirelabs.com/unix_ti...03/11172003.htm]
|