- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: sed command to change /usr/local/bin to \/usr...
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
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
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
тАО10-10-2003 01:20 AM
тАО10-10-2003 01:20 AM
Any ideas?
I tried s/\//\\\//g but no luck.
Jack...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:24 AM
тАО10-10-2003 01:24 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
I'd say something like
tr '\\' '/'
should work, but haven't given it a try myself yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:27 AM
тАО10-10-2003 01:27 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
Just change the order of arguments to tr
e.g.
# pwd|tr '/' '\\'
\usr\local\sbin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:33 AM
тАО10-10-2003 01:33 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
echo /usr/local/bin | | sed -e "s!/!\\\\/!g"
Using ! as the delimiter makes things a bit easier. Note that you have to output two backslashes in sed, becasue \ is also a shell escape char.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:33 AM
тАО10-10-2003 01:33 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
echo "/usr/local/bin" | sed -e 's/\//\\\//g'
Rgds
JL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:34 AM
тАО10-10-2003 01:34 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:39 AM
тАО10-10-2003 01:39 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
The tr command apparently only works for a single character. I wanted to change one character to two characters.
jack...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:39 AM
тАО10-10-2003 01:39 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:47 AM
тАО10-10-2003 01:47 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
I got a sed file that contains the following:
s/\//\\//g
If I use command withoutout the sed file it works, when I use the sed command file it fails with the following:
sed: "s/\//\\//g" is not a recognized function.
any ideas for this twist?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2003 01:51 AM
тАО10-10-2003 01:51 AM
Re: sed command to change /usr/local/bin to \/usr\/local\/bin
e.g. s!\/!\\/!g
Thanks to all...