[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash -n doesn't seem to catch all syntax errors...
From: |
Andreas Schwab |
Subject: |
Re: bash -n doesn't seem to catch all syntax errors... |
Date: |
Tue, 16 Oct 2007 17:14:12 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) |
"Ken Failbus" <failbus@ulticom.com> 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, schwab@suse.de
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."