Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: string equal problem
- X-seq: zsh-users 15836
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Lyre <4179e1@xxxxxxxxx>
- Subject: Re: string equal problem
- Date: Mon, 07 Mar 2011 10:13:59 +0100
- Cc: zsh-users@xxxxxxx
- In-reply-to: <AANLkTi=GJPW=cVoA5hxbgVLsVMpeFehiZFjjU-dd04ow@mail.gmail.com> (Lyre's message of "Mon, 7 Mar 2011 17:04:48 +0800")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTi=GJPW=cVoA5hxbgVLsVMpeFehiZFjjU-dd04ow@mail.gmail.com>
Lyre wrote:
> To my surprise,the following statment:
>
> if [ "abc" == "def" ]; then echo y; else echo n; fi
>
> doesn't work, it says "zsh: = not found".
`==' only works in "[[ ... ]]". So, either use
if [ "abc" = "def" ]; then
or
if [[ "abc" == "def" ]]; then
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author