Hi Dan, I'm sorry if I missed any prologue as your Subject: let me guess (" one *more* array ...") but I read your code and it seems you're poorly reinventing the xargs command so I would like to know if it's intentionnal.
<<% y=0 xargs ksh -c ' for it; do echo new argument: $it; done echo y is still $y ' -- hello dan nuggetsman % > y=0 > arg[$y]="hello" > y=$y+1 > arg[$y]="dan" > y=$y+1 > arg[$y]="nuggetsman" ksh family is really (maybe not ksh93?) are really limited when it comes to array subscripts. if you want to write those kind of stuff, prefer zsh. however I suggest you to be more unix idiomatic which is basically rely on external commands and stdios instead of shell features (you'll discover dash is more than enough in 90% of the shell scripting). In this case, using xargs will offer you parallelization and robustness. so rely on pipes, awk, sed, tr, paste, join, jolt, ... instead of ksh features which are (and still should remain on purpose) really limited. If you want to try harder with pure shell, change your strategy a little bit with the set command (to redefine "$@") or read with IFS. set -- $( cat file.txt ) # only with barewords { tr '\n' : | { # be aware the values are read in a subshell IFS=: read a b c d echo a = $a echo b = $b } echo "a = $a (already gone)" echo "b = $b (already gone)" } <<% those are values I expected % regards -- Marc Chantreux Pôle CESAR (Calcul et services avancés à la recherche) Université de Strasbourg 14 rue René Descartes, BP 80010, 67084 STRASBOURG CEDEX 03.68.85.60.79
signature.asc
Description: PGP signature