Re: [PATCH] [MAN] Document optional open parenthesis for case patterns.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 07, 2010 at 10:42:19PM -0400, Philipp Weis wrote:

> while inspecting some dash scripts on my system, I was surprised to
> see that some of them use an open parenthesis at the beginning of case
> patterns while that's not mentioned in the manpage. Dash currently is
> fine with and without that parenthesis (parser.c:413).

BTW, This feature is a workaround:
Without the left paren, several shells¹ are confused with "case"
inside $( ), because now the parens are not "balanced" anymore.
Although dash doesn't need this (in fact any ash variant),
it was added ('99) for reasons of script portability.
Another benefit is easy searching for matching parens in editors.

¹ bash pre-4, ksh88, pdksh-variants
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux