Fixing bdf output
The output of the bdf command is not formatted in a reader friendly fashion. For example the output of bdf sometimes writes the disk usage details in two lines
Filesystem kbytes used avail %used Mounted on
/dev/sapsidvg/lvsapmnt
8388608 3450677 4670062 42% /sapmnt
To format the output properly, use the following awk trick:
bdf | awk '{if (NF==1) {line=$0;getline;sub(" *"," ");print line$0} else {print}}'
The output know will look like this:
Filesystem kbytes used avail %used Mounted on
/dev/sapsidvg/lvsapmnt 8388608 3450680 4670058 42% /sapmnt
Filesystem kbytes used avail %used Mounted on
/dev/sapsidvg/lvsapmnt
8388608 3450677 4670062 42% /sapmnt
To format the output properly, use the following awk trick:
bdf | awk '{if (NF==1) {line=$0;getline;sub(" *"," ");print line$0} else {print}}'
The output know will look like this:
Filesystem kbytes used avail %used Mounted on
/dev/sapsidvg/lvsapmnt 8388608 3450680 4670058 42% /sapmnt
Comments
Post a Comment