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

Re: weird behaviour of quotes in dash variable assignments



On Sun, Sep 20, 2020 at 09:18:33PM -0400, Gary Dale wrote:
> > > > The line causing the problem reads: report="/root/clamscan-report"

There is nothing wrong with that alleged line.

There is an incredible lack of openness and forthrightness in this
thread.  What are you hiding?  Why are you hiding it?

> > Have you tried single quotes?
> 
> Wouldn't want to. Single quotes alter the behaviour.

False.  Either type of quotes is perfectly fine in this case.

The fact that you make this claim tells me one of the following two
things is true:

 * You have no idea what you're doing, and you are GUESSING that
   changing the quotes would cause an issue, but you did not actually
   try it.

 * The whole discussion is founded on falsehoods.  There's something
   you're not telling us.  The "line" in question is falsified, or it's
   part of some larger context which is being hidden, and this context
   is vitally important to understanding the problem.

I'm leaning toward the latter.

What you should do is produce the smallest possible script that still
exhibits the problem, and post that script, plus its output.  Obviously
you'd add something like  echo "$report"  to the script.  Even better
would be  printf '%s\n' "$report"  .  Better still would be
printf %s "$report" | hd  .  Or you could just add set -x to the script.


Reply to: