Bash intercepting wildcard in script
- by MrRoth
I am using Bash script to read line by line from a text file, which has special characters in it (regular expression). When I use echo "${SOME_VAR}" it does not display the text as is.
I am familiar with Prevent * to be expanded in the bash script.
How can I display and use the text as is?
UPDATE
The text (TSV) file holds tuples similar to (the last entry is a psql query)
bathroom bathroom select name from photos where name ~* '\mbathroom((s)?|(''s)?)\M';
I am reading the CSV as follows:
tail -n+2 text.file | while IFS=$'\t' read x y z
do
echo "${z}"
done
which gives the output
select name from photos where name ~* 'mbathroom((s)?|(''s)?)M');
note that the '\' is missing