Answers for "sed with variable"

2

sed replace with variable

Just concatenate var '"$var"' to replace values string in sed command:
$ sed -i 's/string_to_replace/'"$var"'/g' file_to_replace.txt
Posted by: Guest on November-03-2020
0

sed with variable

sed -i "s/$var1/ZZ/g" "$file"
Posted by: Guest on August-03-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language