- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help with awk
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 01:40 PM
12-19-2007 01:40 PM
Help with awk
I'm trying to remove the % sign from the following awk command:
memchk | grep physical | awk '{print $5}'
The value printed is 75% need to find a way to remove the % sign.
Thank you for your input.
Norm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 01:41 PM
12-19-2007 01:41 PM
Re: Help with awk
memchk | grep physical | awk '{print $5}' | tr -d "%"
Hasan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 01:44 PM
12-19-2007 01:44 PM
Re: Help with awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 01:44 PM
12-19-2007 01:44 PM
Re: Help with awk
This should also work
memchk | grep physical |awk '{print $5}' | awk -F '%" '{print $1}'
Regards
Padma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 02:17 PM
12-19-2007 02:17 PM
Re: Help with awk
You could also do:
# memchk|awk '/physical/ {sub(/%/,"",$5);print}'
This eliminates the extra process (viz. 'grep') along with accomodating your request!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 03:32 PM
12-19-2007 03:32 PM
Re: Help with awk
Norm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 11:17 PM
12-19-2007 11:17 PM
Re: Help with awk
http://forums12.itrc.hp.com/service/forums/helptips.do?#41
http://forums12.itrc.hp.com/service/forums/helptips.do?#33
Questions or topics with unassigned points
http://forums11.itrc.hp.com/service/forums/pageList.do?userId=CA38694&listType=unassigned&forumId=1