0
下面是我的代码片段,我试图输出一个文件名在两端都有双引号。如何在kornshell中的变量空格中加上双引号
#!/usr/bin/ksh
.......
##the value is: Site Information_2013-07-05-00-01-26.CSV
RemoteFile=$(grep "$File" "$TempLog")
##then Im trying to redirect it to a file so that it will have double quotes
echo "\"$RemoteFile\"" > cmd
##I'm expecting below output.
"Site Information_2013-07-05-00-01-26.CSV"
##instead, the double quote is missing at the end, can someone point out what I'm doing wrong
"Site Information_2013-07-05-00-01-26.CSV
谢谢。
您的代码很好,所以在您没有向我们展示的内容中存在问题。 –
即使'echo \“$ RemoteFile \”'也足够了。 – devnull
只是为了实验 - 什么会'回声'\“$ RemoteFile \”\“”> cmd'返回? –