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

Comments

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher