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


Groups > gnu.bash.bug > #15301

Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string
Date Tue, 6 Aug 2019 16:00:21 -0400
Lines 25
Approved bug-bash@gnu.org
Message-ID <mailman.968.1565121631.1985.bug-bash@gnu.org> (permalink)
References <5202404D-4B1E-4627-9FDE-2E0C5608A5B7@outlook.com> <20190806200021.GK1218@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1565121632 7128 209.51.188.17 (6 Aug 2019 20:00:32 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
Mail-Followup-To bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <5202404D-4B1E-4627-9FDE-2E0C5608A5B7@outlook.com>
User-Agent Mutt/1.10.1 (2018-07-13)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20190806200021.GK1218@eeg.ccf.org>
X-Mailman-Original-References <5202404D-4B1E-4627-9FDE-2E0C5608A5B7@outlook.com>
Xref csiph.com gnu.bash.bug:15301

Show key headers only | View raw


On Tue, Aug 06, 2019 at 06:18:27PM +0000, Mohamed Akram wrote:
> Bash version: GNU bash, version 5.0.7(1)-release (x86_64-apple-darwin18.5.0)
> 
> Example:
> 
> shopt -s nullglob
> a='\x30'
> echo $a
> 
> Expected output:
> 
> \x30
> 
> Actual output:
> 

Also happens in bash 5.0 on Debian GNU/Linux.  It does not happen in
bash 4.4 or earlier (I tried back to 3.2) on the same machine.

For the record,   echo $a   is *not* a sane way to see the contents of
your variable.   printf %s\\n "$a"   is the safest.   echo "$a"   would
be marginally acceptable in some cases.  Unquoted $a is a bad idea, which
may explain why it didn't receive enough testing to uncover whatever
this is.  No sane person would do it.

Back to gnu.bash.bug | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-06 16:00 -0400
  Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-08-06 21:28 +0100
    Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-08-06 21:39 +0100
      Re: Setting nullglob causes variables containing backslashes to be expanded to an empty string Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-08-06 21:42 +0100

csiph-web