Thread: ksh arrays
View Single Post
  #2   (View Single Post)  
Old 6th May 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Default

I really have to question why you're writing a script for KSH and not using a more popular shell such as bourne or BASH ?

Ignoring that .... Maybe this will clear some things up:

Code:
$ set -A someArray `ls *.jpg`
$ echo ${somearray[*]}
blah.jpg
something.jpg
file.jpg
aa.jpg
$echo ${somearray[0]}
blah.jpg
make any sense?

If you're going to use a variable to store the contents of the output of an application you need to put it in these backquotes ` `
Reply With Quote