df -k | nawk ' function num_to_letter(val) { if (val=="1") notation = "K" else if (val=="2") notation = "M" else if (val=="3") notation = "G" else notation = "Error" return notation } function num_convert(v) { cnt=0 CONV_FACTOR=1024 while ( (v / CONV_FACTOR) > 1 ) { v /= CONV_FACTOR; cnt++; } return v""num_to_letter(cnt); } { print num_convert($2) } '