- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to remove some null or unprintable characters ...
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
Discussions
Discussions
Forums
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
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
тАО06-15-2004 06:13 AM
тАО06-15-2004 06:13 AM
HOW?
Solved! Go to Solution.
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2004 12:39 PM
тАО06-15-2004 12:39 PM
Re: how to remove some null or unprintable characters withing a string
1. Do you know all the null/unprintables you want to eliminate?
2. Is there a field separator involved with "HP-UX"?
Many ways to do this dependent upon #1, such as sed, tr, awk, etc.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2004 01:21 PM
тАО06-15-2004 01:21 PM
Re: how to remove some null or unprintable characters withing a string
print "$var" | strings
- Tags:
- strings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2004 01:41 PM
тАО06-15-2004 01:41 PM
SolutionYou may want to use 'tr'. Check out 'man tr'
Notably:
-d to delete character
-c to specify the complement character range
by combining you deleted everthing except the characters listed. For example:
$ export test="-test .,;HP-UX% -"
$ echo $test | tr -cd "\-[:upper:]" | read xyz
$ echo $xyz
-HP-UX-
$ echo $test | tr -cd "\-[:upper:][:lower:]" | read xyz
$ echo $xyz
-testHP-UX-
Hein
- Tags:
- tr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2004 01:27 AM
тАО06-16-2004 01:27 AM
Re: how to remove some null or unprintable characters withing a string
echo "${xyz}" | cat -vte
The -vte options for cat are:
-v show non-printable characters as '^' followed by a character. i.e. the NULL character shows up as '^@'
-t show tabs as '^I'
-e show end-of-line as '$'
- Tags:
- cat