zsh-users
 help / color / mirror / code / Atom feed
From: Frank Gallacher <franxg@gmail.com>
To: "Kusalananda Kähäri" <andreas.kahari@abc.se>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: SUMMARY Re: Use of == in functions
Date: Sun, 12 Jan 2020 10:33:49 +0000	[thread overview]
Message-ID: <DM6PR13MB3305C8313024AD675D6AC889F23A0@DM6PR13MB3305.namprd13.prod.outlook.com> (raw)
In-Reply-To: <20200112100906.GA95942@pooh.prefix.duckdns.org>

On 12/1/20, 9:09 pm, "Kusalananda Kähäri" <andreas.kahari@abc.se> wrote:

    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)

Thanx Andreas,

(I stand corrected!)

Frank C.Gallacher
(franxg@gmail.com)

  reply	other threads:[~2020-01-12 10:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12  8:34 Frank Gallacher
2020-01-12 10:09 ` Kusalananda Kähäri
2020-01-12 10:33   ` Frank Gallacher [this message]
     [not found] ` <20200112100906.GA95942__47727.4053309642$1578823915$gmane$org@pooh.prefix.duckdns.org>
2020-01-12 12:03   ` Stephane Chazelas
2020-01-12 13:58     ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR13MB3305C8313024AD675D6AC889F23A0@DM6PR13MB3305.namprd13.prod.outlook.com \
    --to=franxg@gmail.com \
    --cc=andreas.kahari@abc.se \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).