So how can bash script syntax be verified that includes shopt???
Is there more option on bash syntax command-line check that would make it 
identify this grammar???

Thanks for the quick reply.

Regards,
Ken
-----Original Message-----
From: Andreas Schwab [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 16, 2007 10:14 AM
To: Ken Failbus
Cc: bug-bash@gnu.org
Subject: Re: bash -n doesn't seem to catch all syntax errors...

"Ken Failbus" <[EMAIL PROTECTED]> writes:

> bash -x /tmp/mydummy   
> + shopt -s extglob
> + rm -f '/tmp/file.+([0-9])'
> + exit 0
>
> But if "bash -n" is run it doesn't understands +([0-9})
> bash -n /tmp/mydummy
> /tmp/mydummy: line 3: syntax error near unexpected token `/tmp/file.+(['
> /tmp/mydummy: line 3: `rm -f /tmp/file.+([0-9])'
>
> Can you provide insight into this.

shopt changes the shell grammar. When it's not executed the modified
grammar is not accepted.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply via email to