I want to take the output of a df -k command and take the first column and put
it into a nice array or list that I can then later put each seperate line into
a command. I have tried a few different versions and can't figure it out.
I'm new to this and I'm sure it is easy but well I'm green what can I say.
The following is one of many attempts.
Please help.
foreach $_ (`df`){
($fs, $kb, $used, $avail, $cap, $mount) = split (" ",/(\S+\\/n));
print $fs if /dsk/;
}
I also thought about creating a file that contains df out put first and then
changing it that way but again I got stuck.
I just want the out put if to be like if I did a df -k | awk ' {print $1}'
Thanks.
Anna