Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to search a value in multiple files and substitute it ? 1

Status
Not open for further replies.

loloman

Technical User
Oct 30, 2002
16
0
0
FR
I want to find a string in multiple files and substitute it with shell command
grep value *.log ....
 
Hi

Code:
find . -type f -exec sed -i 's/string/grep value *.log ..../g' '{}' \;
This is exactly what you asked for. If you mean "substitute it with shell command[red]'s output[/red]", then you have to reformulate your question.

Feherke.
 
Thank you
I want to replace "Aborted" by "Vu" in files *.log

It's ok with this command
find . -type f -name '*.log' -exec sed -i 's/Aborted/Vu/g' '{}' \;
 
Hi,

Usually, log files are intented to relate what was happened during process execution. It's a bad idea to replace manually things in log files.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top