- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- weird sed
Operating System - Tru64 Unix
1753971
Members
7945
Online
108811
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО08-11-2004 05:53 AM
тАО08-11-2004 05:53 AM
OS: tru64unix V4.0G, Shell: csh
# which sed
/usr/bin/sed
# echo "a b" | sed 's/ /\t/'
atb
???
I am expecting a TAB between "a" and "b", not "atb", what am I doing wrong?
Seems sed won't recognize all escape sequences such as \n,\t,\r,\b ...
Anyone have comment on this? much appreciated.
# which sed
/usr/bin/sed
# echo "a b" | sed 's/ /\t/'
atb
???
I am expecting a TAB between "a" and "b", not "atb", what am I doing wrong?
Seems sed won't recognize all escape sequences such as \n,\t,\r,\b ...
Anyone have comment on this? much appreciated.
Solved! Go to Solution.
- Tags:
- sed
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 06:09 AM
тАО08-11-2004 06:09 AM
Re: weird sed
# echo "a b" | sed 's/ /\\\t/'
a\tb
Also not what I wanted :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 06:27 AM
тАО08-11-2004 06:27 AM
Solution
I think that the \t convention is unfortunately for output only.
For input, just type in a tab!
a reference in this area:
http://www.unixguide.net/unix/sedoneliner.shtml
:
"USE OF '\t' IN SED SCRIPTS: For clarity in documentation, we have used
the expression '\t' to indicate a tab character (0x09) in the scripts.
However, most versions of sed do not recognize the '\t' abbreviation,
so when typing these scripts from the command line, you should press
the TAB key instead. '\t' is supported as a regular expression
metacharacter in awk, perl, and in a few implementations of sed. "
Hein.
For input, just type in a tab!
a reference in this area:
http://www.unixguide.net/unix/sedoneliner.shtml
:
"USE OF '\t' IN SED SCRIPTS: For clarity in documentation, we have used
the expression '\t' to indicate a tab character (0x09) in the scripts.
However, most versions of sed do not recognize the '\t' abbreviation,
so when typing these scripts from the command line, you should press
the TAB key instead. '\t' is supported as a regular expression
metacharacter in awk, perl, and in a few implementations of sed. "
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 09:24 AM
тАО08-11-2004 09:24 AM
Re: weird sed
Thanks Hein.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP