AraR87
1
Guys,
I have a requirement as below
36%/
55%/var
82%/tmp
74%/opt
now i want the output to be
---------------------------------
Disk% Mount
---------------------------------
36% /
55% var
82% tmp
74% opt
----------------------------------------
I have used awk command to get this done. But i am not able to get the exact output.
Could you please help me anyone?
Thanks
Jotne
2
This is basic functionality...
awk 'BEGIN {print "---------------------------------";print "Disk% Mount";print "---------------------------------"} {print} END {print "---------------------------------"}' file
or
awk 'BEGIN {
print "---------------------------------"
print "Disk% Mount"
print "---------------------------------"}
{print}
END {
print "---------------------------------"}' file
sed 's/^\([0-9]\{1,2\}%\)\/$/\1 \//; s/^\([0-9]\{1,2\}%\)\/\([a-z]*\)$/\1 \2/' file
awk -F '/' '$2=="" {$2 = "/"} {print $1 "\t" $2}' file
AraR87
4
Guys thanks for ur help!!!!