954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

editting questions

I know I can do " sed 's/old/new/g' filename to make the change to standard output.... however, is there a way that it would save the change to the file instead of just showing to the screen?

Another question on ed, i know i can search by using /target/ , but for example i need to change one of the x to y in a file which contains 50 x there. How do i pick the specific x I am looking for and do the change only to that specific x? Can anyone please give a quick example?

k2k
Posting Whiz
352 posts since Nov 2007
Reputation Points: 15
Solved Threads: 1
 

1. Look up the > and >> output redirection (and < input redirection)

2. Most ed command can be prefixed with a count, something like say 20s/target/

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You