gartie
1
Hi all,I have to get a script together that pulls out the total size and use% space from rootvg, and sends it to an output file.
df -h
/Filesystem Size Used Avail Use% Mounted on/dev/mapper/rootvg-LogVol00 744M 414M 293M 59%
I am not really a competent scripter and any help would be appreciated.
Try:
df -h | awk ' $1 ~ /rootvg/ {print $2, $5}' >> yourfile.txt
gartie
3
Hi,
tried running the command, and I received a bunch of blank lines.
thanks,
gartie
RudiC
4
Please use code tags as required by foru rules!
What be the output without redirection? Post output of df -h
also.
gartie
5
The out put of the
df -h | awk ' $1 ~ /rootvg/ {print $2, $3}'
comes up as all blank lines. How would you like me to post them? I did not know that my description was vague.
RudiC
6
No need to be upset. What is the output of your df -h
?
gartie
7
Sorry if I appeared upset, I really am not.. It is coming up with blank lines - there is no output
---------- Post updated at 05:03 PM ---------- Previous update was at 05:02 PM ----------
I tried running it as a line command, and then into a file.. with the same results.
RudiC
8
If df -h
alone prints blank lines, I'm not surprised the piped awk also prints blank lines.