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

Re: Vim syntax file for zsh



* Stephane Chazelas <Stephane_Chazelas@xxxxxxxx> [Dec 11, 2004 17:30]:
> > 	% echo hi[
> > 	zsh: bad pattern: hi[
> > 	% [ -n "$1" ]
> > 	%
> > 
> > Quoting the first makes sense if you want to echo the string "hi[".
> > Quoting the [ in [ -n "$1" ] makes no sense at all.
> > Or am I misunderstanding something?
> Yes, you're right, I had not made the test myself as I expected
> it to work the same as in any other shell.

> echo foo[

> works OK in every shell but zsh.

	% setopt nobadpattern
	% echo hi[
	hi[

> If you've got a command named foo[, though, 

> foo[ bar

> doesn't work with ksh or bash (because, they take it as the
> start of an array subscript assignment). It's OK with pdksh,
> though.

Yeah, [ is heavily overloaded ;-),
	nikolai

-- 
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}



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