Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #227256

Re: weird behaviour of quotes in bash variable assignments

From Gary Dale <gary@extremeground.com>
Newsgroups linux.debian.user
Subject Re: weird behaviour of quotes in bash variable assignments
Date 2020-09-22 22:40 +0200
Message-ID <ARXeW-5MB-1@gated-at.bofh.it> (permalink)
References (1 earlier) <ARoTT-1Pp-1@gated-at.bofh.it> <ARAs2-zT-3@gated-at.bofh.it> <ARABH-D0-3@gated-at.bofh.it> <ARBxL-1dM-5@gated-at.bofh.it> <ARJlD-5U8-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2020-09-22 01:48, Andrei POPESCU wrote:
> On Lu, 21 sep 20, 17:22:26, Gary Dale wrote:
>> I presented the line that failed, copied and pasted from the Konsole
>> session. What more do you want, other than to complain?
> In such cases it is best to attach[1] the smallest complete[2] script
> demonstrating the behaviour.
>
> Based on the information provided so far it is highly likely the issue
> was caused by some detail you omitted because you decided it is not
> relevant.
>
> [1] as demonstrated, copy-pasting can alter content
> [2] as discussed, the shebang line can make a big difference
>
> Kind regards,
> Andrei

Your first point makes it impossible for me to present anything because 
this list doesn't (AFAIK) allow attachments. I can only present a 
copy-pasted example.

Your second point would assume that I'm using a non-standard shebang. I 
use #!/bin/sh unless I need something that is only available in bash 
(can't recall a case of that). Moreover, the consensus seems to be that 
if there was an error on the shebang line, the default shell would be used.

The smallest complete script then is

report=”/root/clamscan-report”
echo $report

but as I explained, that works on one server but not the other. Hence my 
question wasn't "what's wrong with this line" but rather "how do I 
change the behaviour". I'm not expecting anyone else to be able to 
reproduce the problem because I can't even do it except on the one server.

And to do that, I didn't even need the shebang line. I could enter the 
line at the command prompt then echo it and see the same result. Since 
it wasn't the shebang line, and didn't even require being in a script, 
why should I have included the shebang line?

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

weird behaviour of quotes in bash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 00:10 +0200
  Re: weird behaviour of quotes in bash variable assignments The Wanderer <wanderer@fastmail.fm> - 2020-09-21 00:20 +0200
    Re: weird behaviour of quotes in bash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 02:40 +0200
      Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 03:20 +0200
        Re: weird behaviour of quotes in dash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 05:00 +0200
          Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 06:00 +0200
            Re: weird behaviour of quotes in dash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 06:20 +0200
        Re: weird behaviour of quotes in dash variable assignments David <bouncingcats@gmail.com> - 2020-09-21 05:40 +0200
          Re: weird behaviour of quotes in dash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 06:10 +0200
            Re: weird behaviour of quotes in dash variable assignments Cindy Sue Causey <butterflybytes@gmail.com> - 2020-09-21 14:00 +0200
              Re: weird behaviour of quotes in dash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-21 14:20 +0200
                Re: weird behaviour of quotes in dash variable assignments David Wright <deblis@lionunicorn.co.uk> - 2020-09-21 16:40 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-22 03:00 +0200
                Re: weird behaviour of quotes in dash variable assignments David Wright <deblis@lionunicorn.co.uk> - 2020-09-22 15:40 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-22 19:40 +0200
                Re: weird behaviour of quotes in dash variable assignments David Wright <deblis@lionunicorn.co.uk> - 2020-09-23 17:50 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 18:40 +0200
                Re: weird behaviour of quotes in dash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-21 18:50 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 19:00 +0200
                Re: weird behaviour of quotes in dash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-21 19:20 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 20:50 +0200
                Re: weird behaviour of quotes in dash variable assignments David Wright <deblis@lionunicorn.co.uk> - 2020-09-22 02:40 +0200
                Re: weird behaviour of quotes in dash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 22:20 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-22 03:10 +0200
                Re: weird behaviour of quotes in dash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-22 06:30 +0200
                Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-22 22:10 +0200
                SSH agent forwarding (was: weird behaviour of quotes in dash variable  assignments) David Christensen <dpchrist@holgerdanske.com> - 2020-09-23 00:40 +0200
        Re: weird behaviour of quotes in dash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-21 14:00 +0200
          Re: weird behaviour of quotes in dash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 18:40 +0200
    Re: weird behaviour of quotes in bash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 03:10 +0200
  Re: weird behaviour of quotes in bash variable assignments <tomas@tuxteam.de> - 2020-09-21 10:00 +0200
    Re: weird behaviour of quotes in bash variable assignments David Christensen <dpchrist@holgerdanske.com> - 2020-09-21 22:20 +0200
      Re: weird behaviour of quotes in bash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-21 22:30 +0200
        Re: weird behaviour of quotes in bash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-21 23:30 +0200
          Re: weird behaviour of quotes in bash variable assignments Andrei POPESCU <andreimpopescu@gmail.com> - 2020-09-22 07:50 +0200
            Re: weird behaviour of quotes in bash variable assignments Gary Dale <gary@extremeground.com> - 2020-09-22 22:40 +0200
              Re: weird behaviour of quotes in bash variable assignments Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-22 23:00 +0200
              Re: weird behaviour of quotes in bash variable assignments Andrei POPESCU <andreimpopescu@gmail.com> - 2020-09-23 12:00 +0200

csiph-web