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


Groups > gnu.bash.bug > #14439

Re: failglob handling

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: failglob handling
Date Fri, 3 Aug 2018 10:59:37 -0400
Lines 31
Approved bug-bash@gnu.org
Message-ID <mailman.4653.1533308419.1292.bug-bash@gnu.org> (permalink)
References <cb5f1669-3a0b-f9ce-6994-e4b0c7d31bd0@gentoo.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1533308420 21127 208.118.235.17 (3 Aug 2018 15:00:20 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Thomas Deutschmann <whissi@gentoo.org>
Envelope-to bug-bash@gnu.org
Mail-Followup-To Thomas Deutschmann <whissi@gentoo.org>, bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <cb5f1669-3a0b-f9ce-6994-e4b0c7d31bd0@gentoo.org>
User-Agent NeoMutt/20170113 (1.7.2)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
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 <http://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>
Xref csiph.com gnu.bash.bug:14439

Show key headers only | View raw


On Fri, Aug 03, 2018 at 03:29:33PM +0200, Thomas Deutschmann wrote:
> However, see the following interesting difference between semicolons and
> newlines:
> 
> > $ echo "shopt -s failglob; echo /foo/bar/*; echo alive; " | bash
> > bash: line 1: no match: /foo/bar/*

Yeah, my own testing confirms that basically, if failglob triggers,
it takes out the entire LINE of commands, not just the one command
that triggered it.

wooledg:~$ shopt -s failglob
wooledg:~$ : /none/*
bash: no match: /none/*
wooledg:~$ : /none/* ; echo hi
bash: no match: /none/*
wooledg:~$ : /none/* || echo hi
bash: no match: /none/*
wooledg:~$ if : /none/* ; then echo yes; else echo no; fi
bash: no match: /none/*

Or, the entire compound command, even if it's across multiple lines:

wooledg:~$ if : /none/* ; then
> echo yes; else echo no; fi
bash: no match: /none/*

That's as far as I cared to test it.  Just another thing to toss on the
heap of not-so-useful shell toys, like set -u.  Not suitable for real
work.

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


Thread

Re: failglob handling Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-03 10:59 -0400

csiph-web