• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Removing non-numeric character from output

Hi All,

On my SunOS 5.9 devbox:

The output of:  df -k |grep /dev/dsk/c0t0d0s0|tail -1|awk '{print $5}'
is:  76%

I need to remove the trailing % sign, as I want to assign this value to a varianble (and then us it in a script to send out notifications)

How do I remove the % from the output?

Regards,
Jo
0
m0nk3yza
Asked:
m0nk3yza
1 Solution
 
zzzztjCommented:
There are many many ways of doing this. This was the first one I could think of  but might be a bit of an overkill.

df -k |grep /dev/dsk/c0t0d0s0|tail -1|awk '{print $5}'  |  sed -e 's/%//g'
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now