Computing.Net > Forums > Unix > truncate the last letter

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

truncate the last letter

Reply to Message Icon

Name: egls
Date: January 9, 2008 at 23:47:54 Pacific
OS: Solaris
CPU/Ram: 2
Product: Sun
Comment:

HI,

How do I remove the percentage from 98% show it only shows 98 using the echo ${abc} command? Thanks

server1:/usr/local/sysbin > echo $abc
98%
server1:/usr/local/sysbin >my_usage2=`echo ${abc}`
server1:/usr/local/sysbin >echo $my_usage2
98%




Sponsored Link
Ads by Google

Response Number 1
Name: fpmurphy
Date: January 10, 2008 at 04:10:59 Pacific
Reply:

echo "98%" | tr % ' '


0

Response Number 2
Name: egls
Date: January 10, 2008 at 17:19:05 Pacific
Reply:

Thanks, my script is working now.



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: truncate the last letter

Throw the last char from string. www.computing.net/answers/unix/throw-the-last-char-from-string/6547.html

how to get the last field www.computing.net/answers/unix/how-to-get-the-last-field/6529.html

sed truncate the result www.computing.net/answers/unix/sed-truncate-the-result/7426.html