Linux – How to remove a certain symbol for a bash script

awkbashgreplinuxscripting

I have a bash script where I get the disk usage, for example 60%. How can I remove the % symbol? Using grep or awk?

Best Answer

This should do it:

sed 's/%//'

Pipe your string through it for the best results.