For scripting, most recommend Bourne-compatible, which includes BASH,
ZSH, DASH, and [PD]KSH.
In my experience, when you stick with a certain subset of what these all
do you'll be "safe" and your scripts will not break if/when you carry
them around.
I have tried to distill some of the lessons learned in recent years into
a "best practice" doc.
https://github.com/trothr/best/blob/main/Shell.md
We talked briefly here about profiling. Easiest way to have consistent
profiling is to *not* use the shell-specific variants.
(For example, if your login shell is BASH, then use ~/.profile and avoid
~/.bash_profile.)
I really need to add this info to that page.
Some people like CSH for interactive work, for which there is TCSH in
open source land. But CSH variants are *not* recommended for scripting.
Coming to closure, I have recently built the following for the Chicory
project:
* bash-5.2.21
* zsh-5.9
* dash-0.5.12
* pdksh-5.2.14
* tcsh-6.24.10
I don't have access to a USS environment which I'm free to use for
public things, so I don't have any of these built for MVS.
The platforms I *do* have include: Linux-i386, Linux-x86_64, Linux-s390,
Linux-s390x, Linux-arm, FreeBSD-amd64, SunOS-i386, SunOS-x86_64.
You can find most of them under rsync://chic.casita.net/opt. (If they're
not there now, they should be in the next 24 hours.)
I hope this helps.
-- R; <><
On 2/19/24 14:31, Pew, Curtis G wrote:
On Feb 17, 2024, at 11:00 AM, Paul
Gilmartin<[email protected]> wrote:
What are the benefits of zsh? Are there incompatibilities?
I largely stay with POSIX shell for portability of scripts and skills.
Apple switched to zsh because newer versions of bash are covered by the GPLv3
license, which is less corporate-friendly than the older GPLv2. I would assume
that IBM has similar motivation.
If you’re still seeing bash on a Mac that probably means you started using it
before the switch. It’s been a while, but when they switched the default I had
to do something (probably in Terminal) to get it to switch for me. (It used to
prompt you to switch if you opened with a bash shell.) There’s still bash
available on MacOS, but it’s a rather old version, 3.2.57 while the current
stable release is 5.2.21.
--
Curtis Pew
ITS Campus Solutions
[email protected]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN