zsh - Append to variable filename in Bash -


why work:

echo "foo" >> ~/desktop/sf-speedtest-output.csv 

but not?

outputfile="~/desktop/sf-speedtest-output.csv" echo "foo" >> $outputfile # error: no such file or directory 

i have tried in ${}, $(), "". not escaping issue?

~-expansion won't happen inside quoted string. can away this:

outputfile=~/"desktop/..." 

or this:

outputfile="$home/desktop/..." 

see tilde expansion or bash manual more details.


Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -