Linked Questions

-1
votes
2answers
806 views

How to use sed on all matching files?

I am trying to run sed on the output from find | grep \.ext$ However, sed requires input file and output file. How can I save the output line to a variable, or pass it to sed?
1
vote
1answer
638 views

How to search-replace-backup files recursively in linux?

I'd like to recursively search for a string within all files in a folder. If the string was found, backup the file to the same location (copy to <filename>-orig) and replace the found string ...
1
vote
1answer
358 views

Escape >');} < / in sed

In 30 files in 30 directories, I want to find: script>');} < /script> and replace it with: script>');} < /script--> What special characters do I need to escape in the find field? ...
0
votes
1answer
214 views

Search and replace something contained in ' (single quotes)

In various files in lots of sub folders I have the following text in large text files, each unique Linux.Secret = 'XYZZYXZYXZYXZYXZYXZ' I would like to make it so all the Linux.Secret = '' are the ...
2
votes
1answer
162 views

What does **/*(D.) mean in (zsh) sed arguments?

I see this command being given as how to search and replace strings in files in this answer: sed -i -- 's/foo/bar/g' **/*(D.) What does the pattern */*(D) mean? I am not sure what they are called, ...
-1
votes
1answer
120 views

Replace a value in a file, in a certain context, with an operation result

I have an array of JSON object with inside local urls and speed parameters like [{server:"192.168.0.100", speed:34}, {server:"192.168.0.130", speed:52},...] I need to update the speed value for each ...

15 30 50 per page