Computing.Net > Forums > Unix > Replace string using tr command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Replace string using tr command

Reply to Message Icon

Name: chain
Date: October 2, 2003 at 19:11:53 Pacific
OS: SunOS5.8
CPU/Ram: not sure
Comment:

Hi,
I am tring to replace a tring that contains 'href' with '\012' which is a newline in octal ASCII using tr, the command is below:

cat newsletter.txt | tr 'href' '\012' > newfilename

But the results is that all strings with 'h' will be replaced and not 'href'. Anyone got any clue ?



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: October 3, 2003 at 03:55:13 Pacific
Reply:

http://computing.net/unix/wwwboard/forum/5518.html


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Replace string using tr command

Search and replace string in files www.computing.net/answers/unix/search-and-replace-string-in-files/7857.html

command TR suddenly fails www.computing.net/answers/unix/command-tr-suddenly-fails/8150.html

How do i use DD command www.computing.net/answers/unix/how-do-i-use-dd-command/2031.html