NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: is /bin/sh the almquist shell?



    Date:        Tue, 29 Mar 2022 23:34:08 GMT
    From:        Mayuresh Kathe <mayuresh%sdf.org@localhost>
    Message-ID:  <202203292334.22TNY8vp027254%sdf.org@localhost>

  | 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


Home | Main Index | Thread Index | Old Index