On 12/23/15 5:26 AM, Bytec GmbH - Helmut Koeberle wrote:
> Hello list,
>
> i have a strange problem in bash with the test command.
>
> Here is my simple bash script 'tst' that checks wether the first char of
> an argument is a slash.
> If the first char of the argument is a special char like '(' then it
> works if there is one expression,
> but not with multiple expressions.
This has to do with the Posix rules for `test'. The behavior is strictly
defined for cases where the number of arguments is 0-4 (and these cases are
documented in the description of `test' in the bash documentation). For
five or more arguments, the expression is parsed according to precedence,
and `(' introduces a parenthesized subexpression.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/