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
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
01-03-2002 03:23 AM
01-03-2002 03:23 AM
od usage
Suppose I have text file & file content is as below.
$cat test
abcd efgh
Now I want to replace \n with \o during usage of od. It is working perfectly.
od -c test | sed 's/\\n/\\o/g'
but if I redirect that output in any test file then I would get octal output . I would not get same character what I had in test. Is it possible to convert from octal to character.
Like it would show as like
abcd efgh\o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 03:31 AM
01-03-2002 03:31 AM
Re: od usage
Do you try this?:
sed 's/$/\\o/g' test > test.out
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 03:38 AM
01-03-2002 03:38 AM
Re: od usage
What do you mean by "redirect the output" gives you octal?
Thanks, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 04:17 AM
01-03-2002 04:17 AM
Re: od usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 04:25 AM
01-03-2002 04:25 AM
Re: od usage
If so, try the tr command:
$ tr '\n' '\0' < input > output
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 05:01 AM
01-03-2002 05:01 AM
Re: od usage
Steven's example of "tr" works. It was confusing when you posted "\o", as it appears you are trying to replace newlines (\n) with nulls (\0 [slash zero] not \o).
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2002 06:33 AM
01-03-2002 06:33 AM
Re: od usage
Here's a little more info...
od is not a text conversion tool - it is a tool used to display the contents of a file and is particularly helpful for determining what unprintable characters may be in a file.
The output of od is always an ascii file (formatted for ease of reading) whether it's to stdout or redirected to a disk file. Test this:
od -c test | sed 's/\\n/\\o/g' >od.output
file od.output
cat od.output
ls -l od.output
od -c od.output
Also, -c argument of od is for ascii representation. To see the octal representation of an ascii test file (like your test file) use -b. Man od for more options.
Darrell
- Tags:
- unprintable chars