From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 08d49455 for ; Sun, 12 Jan 2020 10:09:59 +0000 (UTC) Received: (qmail 15928 invoked by alias); 12 Jan 2020 10:09:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24648 Received: (qmail 3868 invoked by uid 1010); 12 Jan 2020 10:09:51 -0000 X-Qmail-Scanner-Diagnostics: from hekla.abc.se by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(158.174.61.227):SA:0(-1.9/5.0):. Processed in 1.725867 secs); 12 Jan 2020 10:09:51 -0000 X-Envelope-From: andreas.kahari@abc.se X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at abc.se designates 158.174.61.227 as permitted sender) Date: Sun, 12 Jan 2020 11:09:06 +0100 From: Kusalananda =?iso-8859-1?B?S+Ro5HJp?= To: Frank Gallacher Cc: zsh-users@zsh.org Subject: Re: Use of == in functions Message-ID: <20200112100906.GA95942@pooh.prefix.duckdns.org> Mail-Followup-To: Frank Gallacher , zsh-users@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, Jan 12, 2020 at 07:34:02PM +1100, Frank Gallacher wrote: > I am converting my functions from bash to zsh, when I do something like: > > > ciao.old () { > if [ $# == 0 ] > then > PARM="-h" > else > PARM=$* > fi > > > I get an error like: > > % ciao.old > ciao.old:8: = not found > > > Using the old FORTRAN syntax, Replacing == with -eq fixes the problem; is this a bug, or just being tricky??? > > TIA, Frankie G. == within [[ ]] = within [ ] ... just like in bash (but bash allows its built in test/[ utility to understand == too) -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden