Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in patterns used for filename expansion (e.g. a[b/c]d)



On Oct 9,  4:12pm, Vincent Lefevre wrote:
} Subject: Re: bug in patterns used for filename expansion (e.g. a[b/c]d)
}
} On 2007-10-09 13:59:44 +0100, Peter Stephenson wrote:
} > As I said on the Austin group list, this isn't a bug.  It's controlled
} > by the option NOMATCH; you'll find that if zsh is in compatibility mode
} > that option is unset.
} 
} OK, but these compatibility modes are not really clear, e.g. which sh
} and which ksh? And what about POSIX?

The intent is that starting zsh as "sh" provides full POSIX compatility.

However, starting zsh as "ksh" has never promised to be 100% compatible
with any version of ksh; it just means that most of the behavior becomes
ksh-like.  Similarly "emulate csh" makes no promise that zsh will be a
drop-in replacement for csh, and even when started as "sh" there is no
specific other-thing-that-calls-itself-"sh" that you can point at to say
"zsh works like that."

That said, the thing zsh-as-ksh is most like is ksh88.
 
} vin:~> ksh --version
} zsh 4.3.4 (i686-pc-linux-gnu)
} vin:~> ksh
} $ ls a[b/*
} ls: a[b/*: No such file or directory
} 
} vin:~> ksh93
} $ ls a[b/*
} > ksh93: syntax error: `[' unmatched

This is exactly the difference between bash and ksh as mentioned on
the austin-group, is it not?

} vin:~> ksh -c 'ls a[b/*'
} ls: a[b/*: No such file or directory
} vin:~> ksh93 -c 'ls a[b/*'
} ls: a[b/*[: No such file or directory

Where'd that extra '[' come from?  I'd say this is a ksh bug.

} vin:~> touch 'a[b/*'
} vin:~> ksh93 -c 'ls a[b/*'
} ls: a[b/*[: No such file or directory
} vin:~> ksh -c 'ls a[b/*'
} a[b/*

Again modulo the extra-bracket bug, this is the bash v. ksh thing.



Messages sorted by: Reverse Date, Date, Thread, Author