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

Re: string equal problem



On 7 March 2011 10:04, Lyre <4179e1@xxxxxxxxx> 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".

you want either [ "abc" = "def" ] or [[ "abc" == "def" ]] (= will work
in [[]] too).

-- 
Mikael Magnusson



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