|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ksh arrays
Hi, I have a ksh script in which I need to fill an array with a list of filenames. It currently works like this: Code:
set -A array \ val1 \ val2 \ val3 However, I was wondering why it's not possible to do something like this to make it easier to parse values to the array: Code:
set -A array <<EOF val1 val2 val3 EOF |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Because it would be syntactically incorrect. You could however do this: Code:
set -A array $( cat << EOF val1 val2 val3 EOF ) |
| The Following User Says Thank You to Scrutinizer For This Useful Post: | ||
Subbeh (01-30-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks, that makes sense
|
|
#4
|
||||
|
||||
|
Or: Code:
array=( val1 val2 val3 ) |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multidimentional arrays in KSH | hraj1984 | Shell Programming and Scripting | 8 | 12-15-2011 08:29 PM |
| Arrays in nawk and ksh | Pablo_beezo | UNIX for Dummies Questions & Answers | 2 | 11-06-2008 05:59 AM |
| Export Arrays in ksh | ricardo.ludwig | Shell Programming and Scripting | 3 | 10-06-2008 03:16 PM |
| Automatic Arrays in ksh | Jonny2Vests | Shell Programming and Scripting | 1 | 02-27-2008 10:20 AM |
| KSH and arrays | whited05 | Shell Programming and Scripting | 1 | 06-24-2005 12:07 PM |
|
|