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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -