[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: weird behaviour of quotes in bash variable assignments



On Tue, Sep 22, 2020 at 04:37:40PM -0400, Gary Dale wrote:
> The smallest complete script then is
> 
> report=”/root/clamscan-report”
> echo $report

There are three errors in this script.

1) There is no shebang line.
2) You've got curly quotes instead of ASCII double-quotes.
3) You used a variable expansion without enclosing it in double quotes,
   in a context where that matters.

If you literally can't see the difference between ”/root/clamscan-report”
and "/root/clamscan-report" (the former is what you have, and the latter
is what it *should* be), then you need to start working with a different
font.


Reply to: