Answers for "how to use sed output to overwrite existin file"

13

linux replace string in all files

sed -i 's/old-text/new-text/g' input.txt
Posted by: Guest on March-31-2020
14

sed replace in file

sed -i 's/foo/bar/g' hello.txt
Posted by: Guest on March-01-2020
1

how to use sed output to overwrite existin file

# Finds a specific string with regex and appends content
# overiding existing file. 
sed '/regex/a' <file> | tee <file>
# Example
sed '/\[task_concurrency\]/a 'execute=True'' carbon.cfg | tee carbon.cfg
Posted by: Guest on July-20-2020

Code answers related to "how to use sed output to overwrite existin file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language