避免shell腳本SQL語句中 *輸出時轉義

腳本test.sh內容以下,在 /home/myname/下執行該腳本,sql

家目錄下有文件a.txt,test.log,test.sh
bash

#!/bin/bashide

sql="select * from emp;"post

echo $sqlspa

echo $sql > test.log
it

執行後結果:class

select test.sh a.txt test.log from emp;test

如何能讓sql中的*不轉義?select

                                                                                                   

修改成以下:腳本

#!/bin/bash
sql="select * from emp;"

echo "$sql"

echo "$sql" > test.log

再次執行,結果以下

select * from emp;

相關文章
相關標籤/搜索