This question is related to awk, I suppose.
I have no experience with awk. I tried lots of things but I could not find any solution.
Actually, I want to read a file line by line, then replace the whole line with perl.
I simplified the code. I hope you can understand.
new_line1=1234567
new_line2=1234/567
perl -pi -e "s/$new_line1/$new_line2/g" $FILE
The problem is that when I use is related to /.
Number found where operator expected at -e line 1, near "s/1234567/1234/567"
syntax error at -e line 1, near "s/1234567/1234/567"
Because bash assumes that perl -pi -e "s/1234567/1234**/**567/g" $FILE
How can I avoid it.
Use a different delimiter from
/if you don’t want to escape it: