Re: Can't unset function with unusual names

2007-10-16 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Even so, if neither -f nor -v are given, you should apply both naming rules. /AnMaster Andreas Schwab wrote: > AnMaster <[EMAIL PROTECTED]> writes: > >> Repeat-By: >> $ .foo-bar() { echo test; } >> $ .foo-bar >> test >> $ unset

Re: Can't unset function with unusual names

2007-10-16 Thread Jan Schampera
Andreas Schwab wrote: >> $ unset .foo-bar >> bash: unset: `.foo-bar': not a valid identifier > > Use unset -f. IMHO there is a bug. The docs say that ''unset'' without a specific switch affects variables AND functions, hence it should allow the names for both (or it should ONLY affect

Re: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Chet Ramey
Ken Failbus wrote: > 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??? One uses the `-O' invocation option to enable and disable shopt options at execution time. You would use `b

Re: Can't unset function with unusual names

2007-10-16 Thread Andreas Schwab
AnMaster <[EMAIL PROTECTED]> writes: > Repeat-By: > $ .foo-bar() { echo test; } > $ .foo-bar > test > $ unset .foo-bar > bash: unset: `.foo-bar': not a valid identifier Use unset -f. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Can't unset function with unusual names

2007-10-16 Thread AnMaster
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/s

RE: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Ken Failbus
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, O

Re: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Andreas Schwab
"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/my

RE: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Ken Failbus
Hi Guys, I got the correct bad example of how bash doesn't perform correct syntax checking. Following example below show that inclusion of "shopt -s extglob" should take care of the extended pattern matching features e.g. +([0-9]). bash -x /tmp/mydummy + shopt -s extglob + rm -f '/tmp/file.+

RE: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Ken Failbus
Hi Guys, I understand that the example I provided is valid, use to writing scripts in correct format. Your explanations are convincing. But I need to provide a better example that what it means that would help you to understand as to where I saw the issue or call it my ignorance of providing w

Re: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Stephane Chazelas
On Mon, Oct 15, 2007 at 06:27:43PM -0400, Ken Failbus wrote: > Hi Guys, > > When I specify on command-line "bash -n ". Bash doesn't > check for valid syntax errors. E.g. if variable is missing a "$" infront > of it while assigning a value. This is not catched by bash. Is there a > more specific op