Dan Crosta on 19 May 2005 18:04:32 -0000 |
Jeff Abrahamson wrote: I want to do the following in bash. I don't see an easy way. (I see very complicated ways.) Anyone see an easy way? There's always: n=0 for val in $array; do echo Element $n of array is $val n=`echo "$n + 1" | bc` done There's also probably a better way to increment $n, but this is the pattern I found first, so I use it. dsc ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|