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

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -