Re: extglob syntax error in function definition

2015-10-08 Thread Chet Ramey
On 10/6/15 8:27 AM, bash...@jonkmans.nl wrote: > Bash Version: 4.3 > Patch Level: 30 > Release Status: release > > Description: > The shell gives a syntax error when defining a function that uses the > extended pattern matching operators. This is fundamental to how the shell works. The s

Re: extglob syntax error in function definition

2015-10-08 Thread Greg Wooledge
On Wed, Oct 07, 2015 at 10:44:20PM -0500, Eduardo A. Bustamante López wrote: > > Repeat-By: > > shopt -u extglob > > isnum () ( shopt -s extglob; case "$1" in [1-9]*([0-9])) return 0 ;; > > *) return 1 ;; esac; ) > > Remember that bash parses and interprets the script line-by-line. If yo

Re: extglob syntax error in function definition

2015-10-07 Thread Eduardo A . Bustamante López
> Repeat-By: > shopt -u extglob > isnum () ( shopt -s extglob; case "$1" in [1-9]*([0-9])) return 0 ;; > *) return 1 ;; esac; ) Remember that bash parses and interprets the script line-by-line. If you want to change the parser's operation (for example, have it recognize the extglob p