a have a pipe delimited file where the 4th column is a text column which are strings that occasionally contain shell script wildcard characters.
Data File:a.dat
A|d|E|"G"
A|B|C|"SEL * FROM TABLE1;"
A|B|C|"SEL * FROM TABLE1;"
I would like to read the file line-by-line and assign each column to a different variable and then print those variables to ab HTML tag to show it in ab HTML report.
I am facing a problem where the 4th column have wild chars like *
while read LINE
do
echo -e $LINE
StartTime=`echo -e $LINE | cut -d "|" -f1`
UserName=`echo -e $LINE | cut -d "|" -f2`
AppID=`echo -e $LINE | cut -d "|" -f3`
QueryText=`echo -e $LINE | cut -d "|" -f4-10`
echo -e "$QueryText"
done < a.dat
It is printing 4th column but replacing *
with all the unix local files located in the script's directory.
How can I only print the 4th column values as is?