|
||||
ksh arrays
i have started to use (better said learn) ksh as a scripting language about a week ago. as i was reading "Learning the Korn Shell (2nd edition)" i have reached at some point the array part.
so i have tried to make the following simple script. Code:
# cat array.sh #!/usr/local/bin/ksh93 K=~/bin cd $K KA=$(ls $PRE.*) print ${#KA[*]} Code:
# ./array.sh 1 Using the -x feature of ksh i have the following output: Code:
# ksh93 -x array.sh + ls addvpn.sh disk.size.sh ksh.sh s.test.sh array.sh vpn.sh + KA=$'addvpn.sh\ndisk.size.sh\nksh.sh\ns.test.sh\nssh.connect.sh\nvpn.sh' + print 1 Code:
... print ${KA[1]} Code:
# ksh93 -x array.sh + ls addvpn.sh disk.size.sh ksh.sh s.test.sh ssh.connect.sh vpn.sh + KA=$'addvpn.sh\ndisk.size.sh\nksh.sh\ns.test.sh\nssh.connect.sh\nvpn.sh' + print '' all the best, v |
Tags |
ksh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Basic Perl arrays question | stukov | Programming | 12 | 18th November 2008 08:44 PM |
How to vectorize a function for numpy arrays in Python | kasse | Programming | 0 | 26th August 2008 12:12 PM |
C 2D arrays | jgroch | Programming | 16 | 2nd August 2008 01:54 AM |