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

Re: Vim syntax file for zsh



* Stephane Chazelas <Stephane_Chazelas@xxxxxxxx> [Dec 10, 2004 16:50]:
> > > If that "[" should be quoted, then that one in:

> > > [ -n "$1" ]

> > > should be to:

> > > '[' -ne "$1" ]

> > Why?

> Because "[" and "hi[" are both arguments to a builtin command (0th of
> the "[" one, and 1st of the "echo" one), there's no reason (not) to
> quote one and not the other.

I think you misunderstand.

	% 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?
	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