Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge 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: References: 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 Envelope-to: bug-bash@gnu.org Mail-Followup-To: Thomas Deutschmann , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14439 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.