Need tokens in shell script

Hi All,

Im writing a shell script in which I want to get the folder names in one folder to be used in for loop.

I have used:

packsName=$(cd ~/packs/Acquisitions; ls -l| awk '{print $9}')
echo $packsName
o/p: opt temp user1 user2 

ie. Im getting the output as a string.

But I want to use these names inside 'for .. in ' loop.
eg.

for var in opt temp user1 user2
do 
  statements;
done

Can anybody help me to get this tokenised?

Thanks.

Have you tried this?

for var in $packsName
do
  ...
done

or this:

cd ~/packs/Acquisitions
for var in *
do
  ...
done

Thanks a lot!!

It worked both ways.