Reputation: 1543
I am writing a shell script which will read a user input and do some processing
echo "Enter your query \n" read query echo $query > temp
I am facing an issue when i enter any special characters. For example if i enter
select * from temp;
the *
in the select statement is getting converted into all the file names in the directory.
Upvotes: 1
Views: 198
Reputation: 37930
Use double quotation marks to prevent looking in the file system:
echo "$query" > temp
Upvotes: 2