Discussion:
is /bin/sh the almquist shell?
(too old to reply)
Mayuresh Kathe
2022-03-29 14:50:14 UTC
Permalink
could i get confirmation that the /bin/sh under netbsd is
indeed the "almquist shell"?
thank you.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Robert Elz
2022-03-29 15:43:11 UTC
Permalink
Date: Tue, 29 Mar 2022 14:50:14 GMT
From: Mayuresh Kathe <***@sdf.org>
Message-ID: <***@sdf.org>

| could i get confirmation that the /bin/sh under netbsd is
| indeed the "almquist shell"?

It is derived from that, yes. As is the FreeBSD shell

It would be a bit of a stretch thes days to say it (either) is
the Almquist shell, but they both still contain quite a bit
of Ken's original code, and certainly the basic design.

But they really aren't "the" Almquist shell, any more than
firefox is netscape.

kre

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mayuresh Kathe
2022-03-29 23:34:08 UTC
Permalink
Subject: Re: is /bin/sh the almquist shell?
Date: Tue, 29 Mar 2022 14:50:14 GMT
| could i get confirmation that the /bin/sh under netbsd is
| indeed the "almquist shell"?
It is derived from that, yes. As is the FreeBSD shell
It would be a bit of a stretch thes days to say it (either) is
the Almquist shell, but they both still contain quite a bit
of Ken's original code, and certainly the basic design.
But they really aren't "the" Almquist shell, any more than
firefox is netscape.
kre
robert, thanks for sharing that bit of information.
i asked the question because i needed to ascertain whether
/bin/sh supports recursion.
based on what i've read on the web (which has left me very
confused), it seems that the original unix "sh" did not
support recursion, and neither did bourne's "sh", and i
did not find any information regarding almquist's "sh"
other than the fact that it was mostly bourne "sh"
compatible with features added-in to better support
job-control.
should i start a separate thread asking for information
regarding netbsd's /bin/sh support for recursion?
thank you.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Robert Elz
2022-03-30 02:50:22 UTC
Permalink
Date: Tue, 29 Mar 2022 23:34:08 GMT
From: Mayuresh Kathe <***@sdf.org>
Message-ID: <***@sdf.org>

| should i start a separate thread asking for information
| regarding netbsd's /bin/sh support for recursion?

New thread? Probably not needed.

To actually answer the question depends exactly what you mean/need.

But as a simple (possibly incorrect) interpretation, the
original Bourne sh had no functions, so the only way it
could do anything recursive was by having a script run itself,
either as a standalone command, or via the '.' command.

All modern shells have functions (they are part of the POSIX
sh spec) and all shell functions have always supported recursion.
Not all shells support local vars in functions however, they are
not in posix. Without them some recursive techniques can be
more difficult.

I believe that the original Almquist shell, and all descended
from it (which includes dash incidentally) support functions
and local variables.


Please read the sh man page.

kre

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mayuresh Kathe
2022-03-30 04:15:44 UTC
Permalink
Subject: Re: is /bin/sh the almquist shell?
Date: Tue, 29 Mar 2022 23:34:08 GMT
| should i start a separate thread asking for information
| regarding netbsd's /bin/sh support for recursion?
New thread? Probably not needed.
To actually answer the question depends exactly what you mean/need.
But as a simple (possibly incorrect) interpretation, the
original Bourne sh had no functions, so the only way it
could do anything recursive was by having a script run itself,
either as a standalone command, or via the '.' command.
All modern shells have functions (they are part of the POSIX
sh spec) and all shell functions have always supported recursion.
Not all shells support local vars in functions however, they are
not in posix. Without them some recursive techniques can be
more difficult.
I believe that the original Almquist shell, and all descended
from it (which includes dash incidentally) support functions
and local variables.
Please read the sh man page.
kre
robert, thanks for responding, with the details. helped me.
about sophisticated recursion; it can be achieved using a
"y-combinator".
again, many thanks. :)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...