Extraction of the output from a string.

Hi Everyone,

           I stored the result of a certain awk script in the variable arr.The result is /inets /banking /tools.

arr= /inets /banking /tools

   These are 3 direcctories. I should be able to move in to these directories using "cd" command.Can you tell me how to extract a particular directory,say '/inets', from this variable?  Thanks in advance to everyone.

Say your variable stores the three dirs
amit@softpc142108 /export/home/amit $ echo $arr
/inets /banking /tools
amit@softpc142108 /export/home/amit $ echo $arr | cut -d ' ' -f1
/inets
amit@softpc142108 /export/home/amit $ echo $arr | cut -d ' ' -f2
/banking
amit@softpc142108 /export/home/amit $ echo $arr | cut -d ' ' -f3
/tools

So you can use

cd `echo $arr | cut -d ' ' -f1`

If you needed to go to each of the directories...

arr="/inets /banking /tools"

for DIR in $(echo ${arr})
do
cd ${DIR}
pwd
done

Thanks a lot both of you..that cleared my problem...One more question...How to prevent the "root" directory details from appearing in the ouput of the df -k command? Basically I am trying to create a disk-monitoring script here...Your help is greatly appreciated...

df -k | grep -v root

Sorry for not being specific...by root i mean "/"...This is the output obtained when i run df -k command:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 10317860 4464896 5328844 46% /
/dev/hdc2 4128432 3840868 77852 99% /banktools
/dev/hda1 256667 60949 182466 26% /boot
/dev/hdc3 4128432 2212820 1705900 57% /home
/dev/hdc1 25802268 20828460 3663084 86% /inets
none 2050664 0 2050664 0% /dev/shm
/dev/hda5 2063504 34000 1924684 2% /tmp
/dev/hda3 8254272 2184980 5649996 28% /var

In order to make my script work I need to remove the entry marked in red from the output.
When i run df -k | grep -v / it is displaying only the following line in the output:
Filesystem 1K-blocks Used Available Use% Mounted on

Thanks a lot for your continual assistance.