zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: bash conversion trouble.
Date: Sat, 25 Feb 2017 12:09:27 -0800	[thread overview]
Message-ID: <170225120927.ZM22787@torch.brasslantern.com> (raw)
In-Reply-To: <afd827df-f319-83c7-f765-26cd3fd4539f@eastlink.ca>

On Feb 25, 11:13am, Ray Andrews wrote:
}
} Interesting.  So bash and ksh went one way an zsh and csh went the 
} other.  Obviously the decision was made in the context of the time, but 
} I'd have expected zsh to go with bash.

The point is that zsh "went" before there were arrays in bash to follow.
"I'd have expected gorillas to be the same color as orangutans."

} One hears nothing but bad things about csh.

Yes, the intent of zsh was to take only the good things from csh and for
everything else be like the Bourne shell (which is NOT "like bash", nor
is it even "like POSIX" which came even later).

Various extensions for bash/ksh compatibility were then added to make
it simpler to do exactly the kind of script conversion you're currently
working on, and to help people migrating from bash et al. in the same
way that the original design was meant to assist people migrating from
csh.

} Yeah, why not just use natural counting?   That array[9] is the tenth
} element has always seemed a bit dumb but I'm used to it from C.

In C it makes sense because arrays are based on pointer arithmetic so
array[0] == *(array+0) == the start of the array.  Shells don't have
such pointer arithmetic, at least not exposed by default.  That's even
the reason that $0 == the program name, because in the underlying C
the 0 element of the array passed to execve() is the program name.


  reply	other threads:[~2017-02-25 22:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25  1:35 Ray Andrews
2017-02-25  4:41 ` Bart Schaefer
2017-02-25 15:13   ` Ray Andrews
2017-02-25 15:26     ` Peter Stephenson
2017-02-25 15:55       ` Bart Schaefer
2017-02-25 16:24         ` Ray Andrews
2017-02-25 17:02           ` Bart Schaefer
2017-02-25 19:13             ` Ray Andrews
2017-02-25 20:09               ` Bart Schaefer [this message]
2017-02-26  5:05                 ` Ray Andrews
2017-02-26 17:19                   ` Bart Schaefer
2017-02-26 18:03                     ` Ray Andrews
2017-02-26 21:10                       ` Shell history (Re: bash conversion trouble.) Bart Schaefer
2017-02-26 23:23                         ` Ray Andrews
2017-02-28 15:56             ` bash conversion trouble Stephane Chazelas
2017-02-28 19:27               ` Ray Andrews

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=170225120927.ZM22787@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).