Re: zsh (was: Strange results for the PS1 prompt ...)

2023-08-18 Thread Paul Gilmartin
On Fri, 18 Aug 2023 12:25:22 -0400, Rick Troth wrote:
>...
>DASH is an excellent test shell for shaking out compatibility problems.
>
But as delivered with many systems it lacks command recall.


>Acorse, the best option would be to run scripts against *several* shells
>(and DASH, BASH, ZSH, and PDKSH are all easy to come by).
>
If the supplier claims compatibility with such shells they should be tested.
But only POSIX should be required.

(Some) Linux distributions implement system() using dash for performance.
Accordingly, there are pleas: "Please, please, add this tiny bashism.  It
would be *so* useful, and not hard to do."  The correct answer is, "No."


>We're also (here) not talking about interactive shell, but we've drifted
>into scripting.
>
Grrr.  Once, using csh (it was a mistake) I discovered that comments
were considered syntax errors in interactive mode.  But I like to
copy/past snippets to command line for tests.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: zsh (was: Strange results for the PS1 prompt ...)

2023-08-18 Thread Rick Troth

On 8/18/23 11:42, Paul Gilmartin wrote:

On Fri, 18 Aug 2023 15:16:13 +, Seymour J Metz wrote:


As long as they included something that looked like the Bourne shell, adding 
other shells as options wouldn't have affected POSIX and X.OPEN compliance.


Bourne shell falls considerable short of POSIX and X.OPEN compliance.
I once told an antiquarian of a SunOS 4 /bin.sh deficiency (tilde expansion,
IIRC.)  He quickly remarked, "Oh, that's Bourne shell."  I believe Bourne
also lacks "$( ... )" command substitution.Perhaps obsessed with
portability, I test some scripts with dash.



DASH is an excellent test shell for shaking out compatibility problems.


Acorse, the best option would be to run scripts against *several* shells 
(and DASH, BASH, ZSH, and PDKSH are all easy to come by).



We're not after Bourne as such, just the common superset. (Where we see 
that both ZSH and BASH vary.)
We're also (here) not talking about interactive shell, but we've drifted 
into scripting.







Preferences in e.g., desktop managers, languages, operating systems, are highly 
subjective; if it works for you, that's what matters.

Now, if you're working on a large project hen some standardization is needed; 
again, if the choices made on the project work for the project, that's what 
matters.


Requirements are stricter for ISVs targeting multiple platforms and FOSS 
developers.



Indeed!
But I always press my teammates (sometimes ISV, but not for the current 
gig) to make their shells portable. It's not difficult and prevents 
"oooppss" when someone else takes their script in a different direction.



https://github.com/trothr/best/blob/main/Shell.md



-- R; <><




--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: zsh (was: Strange results for the PS1 prompt ...)

2023-08-18 Thread Paul Gilmartin
On Fri, 18 Aug 2023 15:16:13 +, Seymour J Metz wrote:

>As long as they included something that looked like the Bourne shell, adding 
>other shells as options wouldn't have affected POSIX and X.OPEN compliance.
>
Bourne shell falls considerable short of POSIX and X.OPEN compliance.
I once told an antiquarian of a SunOS 4 /bin.sh deficiency (tilde expansion,
IIRC.)  He quickly remarked, "Oh, that's Bourne shell."  I believe Bourne
also lacks "$( ... )" command substitution.Perhaps obsessed with
portability, I test some scripts with dash.

>Preferences in e.g., desktop managers, languages, operating systems, are 
>highly subjective; if it works for you, that's what matters.
>
>Now, if you're working on a large project hen some standardization is needed; 
>again, if the choices made on the project work for the project, that's what 
>matters.
>
Requirements are stricter for ISVs targeting multiple platforms and FOSS 
developers.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: zsh (was: Strange results for the PS1 prompt ...)

2023-08-18 Thread Seymour J Metz
As long as they included something that looked like the Bourne shell, adding 
other shells as options wouldn't have affected POSIX and X.OPEN compliance.

Preferences in e.g., desktop managers, languages, operating systems, are highly 
subjective; if it works for you, that's what matters.

Now, if you're working on a large project hen some standardization is needed; 
again, if the choices made on the project work for the project, that's what 
matters.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [042bfe9c879d-dmarc-requ...@listserv.ua.edu]
Sent: Friday, August 18, 2023 9:31 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: zsh (was: Strange results for the PS1 prompt ...)

(Please change the Subject: as the topic drifts.)

On Fri, 18 Aug 2023 11:07:29 +, Seymour J Metz wrote:

>While, IMHO, zsh should have been included in MVS/ESA SP V4.3 OpenEdition, I 
>don't see it killing bash, due to compatibility.
>
POSIX non-compliance or incompatibility. with bash?

My desktop OS lately made zxh the default; I stayed with bash.

>
>From: David Crayford
>Sent: Friday, August 18, 2023 5:38 AM
>Subject: Re: Strange results for the PS1 prompt with z/OS Unix
>...
>Incidentally, I noticed that IBM are shipping zsh as part of z/OS 3.1 so
>bye, bye bash.

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN