I am using ksh to get one line csv file from the output of df -k. The only information i need is: File System Name and FS Usage Example:
/,50,/usr,45,/var,43 All info in ONE line
I am using this script:
#!/bin/ksh
cat dftmp | grep "%" | awk '{printf "%d,%s\n", $5, $6}' > dftmp2
cat dftmp2 | gawk '{var=var "," $0} END{print substr(var,2)}'
Now problem is the following:
in dftmp2 i have:
/,50
/usr,45
/var,43
But the ouput of the second command does not give me everything in one line. All info appeared overlapped in one line as:
,43,/var
Any idea why?. I am using GNU linux 2.6.18-8.el5
/,50,/usr,45,/var,43 All info in ONE line
I am using this script:
#!/bin/ksh
cat dftmp | grep "%" | awk '{printf "%d,%s\n", $5, $6}' > dftmp2
cat dftmp2 | gawk '{var=var "," $0} END{print substr(var,2)}'
Now problem is the following:
in dftmp2 i have:
/,50
/usr,45
/var,43
But the ouput of the second command does not give me everything in one line. All info appeared overlapped in one line as:
,43,/var
Any idea why?. I am using GNU linux 2.6.18-8.el5
Comment