zsh-users
 help / color / mirror / code / Atom feed
From: Frank Gallacher <franxg@gmail.com>
To: zsh-users@zsh.org
Subject: Use of == in functions
Date: Sun, 12 Jan 2020 19:34:02 +1100	[thread overview]
Message-ID: <E24B3792-AAC1-4024-9B5C-708AC88769CE@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

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.

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12  8:34 Frank Gallacher [this message]
2020-01-12 10:09 ` Kusalananda Kähäri
2020-01-12 10:33   ` SUMMARY " Frank Gallacher
     [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=E24B3792-AAC1-4024-9B5C-708AC88769CE@gmail.com \
    --to=franxg@gmail.com \
    --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).