Hi

Ok, that explain it.

Regards,

// Ola

On Sun, Aug 27, 2006 at 02:26:21PM +0200, Miroslav Kure wrote:
> On Sun, Aug 27, 2006 at 12:00:25PM +0200, Ola Lundqvist wrote:
> > 
> > The reason for this was that bash -n script showed syntax error. I
> > found it because lintian gave a warning. Have I missed something or
> > is bash -n broken?
> 
> I would say that bash -n is broken, because my bash manual says:
> 
>  case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac
>    A case command first expands word, and tries to match it against
>    each pattern in turn, using the same matching rules as for path
>    name expansion (see Pathname Expansion  below).
> 
> Then later in the Pathname Expansion:
> 
>  If the extglob shell option is enabled using the shopt builtin, several
>  extended  pattern  matching operators are recognized.  In the following
>  description, a pattern-list is a list of one or more patterns separated
>  by a |.  Composite patterns may be formed using one or more of the
>  following sub-patterns:
> 
>   *(pattern-list)
>      Matches zero or more occurrences of the given patterns
>   ...
> 
> The simple test on command prompt confirms this behaviour:
> 
>  ~$ case abbbc in a*(b)c) echo "ok";; esac
>  bash: syntax error near unexpected token ('
> 
>  ~$ shopt -s extglob
>  ~$ case abbbc in a*(b)c) echo "ok";; esac
>  ok
> 
> As bash -n newvserver is failing with:
>  newvserver: line 234: syntax error near unexpected token ('
>  newvserver: line 234: `                     [a-z0-9]*([a-z0-9_-])[a-z0-9])'
> 
> it looks like bash -n does not honour the extglob option.
> 
> -- 
> Miroslav Kure
> 

-- 
 --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/  [EMAIL PROTECTED]                   Annebergsslingan 37        \
|  [EMAIL PROTECTED]                   654 65 KARLSTAD            |
|  http://opalsys.net/               Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to