![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bourne-again shell | mrsamer | UNIX for Dummies Questions & Answers | 3 | 09-30-2006 02:42 AM |
| bourne shell programming help | ganjakh0r | Shell Programming and Scripting | 1 | 11-27-2005 08:38 PM |
| bourne shell not working | gillbates | Shell Programming and Scripting | 6 | 06-17-2004 04:22 PM |
| UNix Bourne Shell | peter112 | Shell Programming and Scripting | 3 | 04-02-2004 10:40 AM |
| Bourne Shell Scripting | Slamo | Shell Programming and Scripting | 3 | 05-19-2003 08:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
There are a few ways to define an array, at least in Bash, and Ksh.
array=(first_member second_member third_member) if you do it this way, the members are assigned sequentially, meaning they can be referenced by their index, which in this case starts at "0" # echo ${array[0]} first_member # echo ${array[1]} second_member # echo ${array[2]} third_member Alternatively, you can assign them like this: # array[2]="hello there" Now, check the value of of [2]: # echo ${array[2]} hello there To display all of the members of the array, use "*" or "@" this can be good for for|while|until loops. # for member in ${array[*]}; do echo $member;done first_member second_member hello there |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|