I have shell script as below
query="SELECT * from [myDB.myTable]"
echo $(date +"%Y-%m-%d %H:%M:%S")'|'land'|'Failure'|||'twice'|'$query > test.log
When I run above in some directory in my Unix PC, the test.log shows the result as below
2017-12-13 06:54:03|land|Failure|||twice| SELECT temp1.txt test tmp.log tt.sh from [myDB.myTable]
Actually I wanted query to be redirected as it is in the log file, instead it printed all the file names of that directory.
How can I fix this issue?