Human readable formatting on the fly with awk

From thelinuxwiki
Jump to: navigation, search

Convert numerical parameters into human readable text


Example:

# echo 1 | awk '{ if ($1==1) print "Active"; if ($1==0) print "Standby";}'
Active
# echo 0 | awk '{ if ($1==1) print "Active"; if ($1==0) print "Standby";}'
Standby