Re: failglob handling

2018-08-03 Thread Chet Ramey
On 8/3/18 9:29 AM, Thomas Deutschmann wrote: > Hi, > > please see the following script: > >> #!/bin/bash >> shopt -s failglob >> if [[ $? -ne 0 ]]; then >> echo 'shopt failed' >> exit 1 >> fi >> >> # Let's view current options just to be sure >> shopt -p >> >> # The following glob

Re: failglob handling

2018-08-03 Thread Greg Wooledge
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 th

failglob handling

2018-08-03 Thread Thomas Deutschmann
Hi, please see the following script: > #!/bin/bash > shopt -s failglob > if [[ $? -ne 0 ]]; then > echo 'shopt failed' > exit 1 > fi > > # Let's view current options just to be sure > shopt -p > > # The following glob should fail because /foo/bar does not exist ... > # Due to 'f