On Mon, 21 Sep 2020 at 11:18, Gary Dale <g...@extremeground.com> wrote:
> >>> I have the same bash script on two different Debian/Buster AMD64 > >>> servers. However on one it refused to run. I tracked it down quickly > >>> to a variable substitution problem. > >>> The line causing the problem reads: report="/root/clamscan-report" > >>> On one server echo $report prints /root/clamscan-report while on > >>> the other it prints "/root/clamscan-report". The shell should strip the double quotes before assigning the right hand string to the left hand variable. Another possibility to check that I haven't seen suggested already, even if it is unlikely ... >From the perspective of not knowing how these bash scripts were deployed, it's worth confirming that what we are assuming is the "same bash script" are indeed exactly identical. $ cmp script1 script2 If somehow the double quotes in the problem script have become something other than plain ASCII 0x22 bytes, that could explain the observed behaviour. Because extended character sets can contain a variety of characters that visually appear identical to their plain ASCII counterparts. But the shell won't parse and remove them as quote characters, even though they "look like" quote characters.