Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Incompatibility when Zsh invoked as 'sh'
- X-seq: zsh-workers 16544
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: DervishD <raul@xxxxxxxxxxxx>
- Subject: Re: Incompatibility when Zsh invoked as 'sh'
- Date: Sun, 3 Feb 2002 20:51:22 -0600
- Cc: Zsh <zsh-workers@xxxxxxxxxx>
- In-reply-to: <E16XVpG-0006tm-00@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <E16XVpG-0006tm-00@xxxxxxxxxxxxxxxxxxxxx>
In the last episode (Feb 04), DervishD said:
> The problem is a 'case' like this (abbreviated):
>
> case "$1" in
> [*) ....
> ;;
> *) ....
> ;;
> esac
>
> Well, the error is the '[*' pattern, which zsh says is a 'bat
> pattern'. Bash treats it as the regex 'match an opening bracket and
> anything after it', but zsh doesn't.
couple datapoints:
ash does not complain; args starting with a bracket match the 1st case.
pdksh-5.2.14 run as sh does not complain, but only the literal argument
[* matches.
The ash manpage, at least, explicitly allows this case:
A left bracket ([) introduces a character class. The end of the
character class is indicated by a ``]''; if the ``]'' is missing
then the ``['' matches a ``['' rather than introducing a character
class.
I don't have a link to the new Single Unix spec at the moment; what's
it say?
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author