- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: sed problem
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
03-05-2003 06:53 AM
03-05-2003 06:53 AM
sed s/[/]/
but hitting the tab key does not work. Any ideas why not? Or how else I might do this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 06:57 AM
03-05-2003 06:57 AM
Re: sed problem
I think you might just be missing quotes. This works for me:
sed 's+/+ +g' filename
where I just pressed that tab key between the 2nd pair of "+" chars.
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 06:58 AM
03-05-2003 06:58 AM
Re: sed problem
simply press the TAB-Button instead of
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:10 AM
03-05-2003 07:10 AM
Re: sed problem
I am hitting the actual tab key and it does not work, either in my example or in Robin's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:26 AM
03-05-2003 07:26 AM
Re: sed problem
Hitting the tab key should work. Try this below:
# echo "field1/field2" | sed 's:/:
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:30 AM
03-05-2003 07:30 AM
Re: sed problem
vi
~
~
~
~
~
:g/\///s//
This will globally change the "/" to a
You will need to :x! to save and exit vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:31 AM
03-05-2003 07:31 AM
Re: sed problem
What does this show:
echo a/b | sed 's+/+ +g' | od -c
I see:
# echo a/b | sed 's+/+ +g' | od -c
0000000 a \t b \n
0000004
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:32 AM
03-05-2003 07:32 AM
Re: sed problem
:g/\//s//
I had one too many "/"'s sorry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:32 AM
03-05-2003 07:32 AM
Re: sed problem
# cat myfile | sed 's/\//
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:37 AM
03-05-2003 07:37 AM
Re: sed problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 07:39 AM
03-05-2003 07:39 AM
SolutionRobin's syntax works fine. Don't copy-and-paste it. Try replicating the TAB character both with the tab key and by pressing "control", "v" and then "I". This can be done at commandline and should act identically to pressing the tab key. In fact, you should see your cursor move.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 08:07 AM
03-05-2003 08:07 AM
Re: sed problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 08:07 AM
03-05-2003 08:07 AM
Re: sed problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 08:08 AM
03-05-2003 08:08 AM
Re: sed problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 10:33 AM
03-05-2003 10:33 AM
Re: sed problem
[immpact:immpacts]:~/bin
bash-2.05$ echo a/b | sed 's+/+ +g' | od -c
0000000 a b \n
0000004
[immpact:immpacts]:~/bin
bash-2.05$
James, when I type ctrl-v then I, I get an I on the line.
Everyone else,
Anything requiring the tab key does not seem to work. At the console, the tab key doesn't do anything. Might this be a shell issue? The account I'm working under uses bash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 10:48 AM
03-05-2003 10:48 AM
Re: sed problem
Anyone have a clue what could be different in the enviroments to cause tab not to work? If it matters, this is a k class running 10.20.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 11:02 AM
03-05-2003 11:02 AM
Re: sed problem
I got this example to work in my bash shell [on my Linux box]:
sed 's#/#\t#g'
The slashes were a little confusing in the substitution syntax, so I replaced them with the '#' sign. For the tab character, I used the \t expression.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 11:21 AM
03-05-2003 11:21 AM
Re: sed problem
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 11:43 AM
03-05-2003 11:43 AM
Re: sed problem
John P: The '\t' to represent a tab character doesn't work in all 'sed' versions. It does in gnu's 'sed' by not the HP version, for instance.
When using the "control, v, I" key sequence to generate a tab, press "ctrl", then press "v" and release that key, and finally while holding down the "ctrl" key, press "I". You should not see a visible "I" unless is appears as "^I". In my case, blank space appears and the cursor moves.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 12:03 PM
03-05-2003 12:03 PM