Escape characters contained by bash variable in regex pattern
- by Skuja
In my bash script, i am trying to execute following Linux command:
sed -i "/$data_line/ d" $data_dir
$data_line is entered by user and it may conatain special characters that could brake regex.
How can i escape all of the possible special characters in $data_line before i execute sed command?