afcnoc
asked on
Need to strip the last character from an awk print statement.
I have the following command that returns the % of disk space used in a partition.
ie: 5%
I need to strip the % off the string and am not sure how to do it.
The command I am using is:
df -lk | awk '{if ($6=="/"){print $5}}'
ie: 5%
I need to strip the % off the string and am not sure how to do it.
The command I am using is:
df -lk | awk '{if ($6=="/"){print $5}}'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works great.