Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

sed replace with variable

Use double quotes to make the shell expand variables while preserving whitespace:

sed -i "s/$var1/ZZ/g" "$file"
Source by askubuntu.com #
 
PREVIOUS NEXT
Tagged: #sed #replace #variable
ADD COMMENT
Topic
Name
8+5 =