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


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

Reply via email to