History log of /netbsd-src/bin/sh/shell.h (Results 1 – 25 of 33)
Revision Date Author Comments
# d1c86d36 09-Oct-2024 kre <kre@NetBSD.org>

PR bin/58687 -- implement suspend as a builtin in sh

Requested by uwe@ in PR bin/58687 without objections from
anyone except me, here is an implementation of a suspend
builtin command for /bin/sh

T

PR bin/58687 -- implement suspend as a builtin in sh

Requested by uwe@ in PR bin/58687 without objections from
anyone except me, here is an implementation of a suspend
builtin command for /bin/sh

The sh.1 man page is updated, naturally, to describe it.

This new builtin does not exist in SMALL shells -- as used
on (some) boot media, etc.

If this turns out not to be useful, it can easily be removed.

show more ...


# 100a3398 09-Feb-2024 andvar <andvar@NetBSD.org>

fix spelling mistakes, mainly in comments and log messages.


# 4ca0efa9 26-Oct-2021 kre <kre@NetBSD.org>

PR bin/56464

After almost 30 years, finally do the right thing and read $HOME/.profile
rather than .profile in the initial directory (it was that way in version
1.1 ...) All other ash descendants

PR bin/56464

After almost 30 years, finally do the right thing and read $HOME/.profile
rather than .profile in the initial directory (it was that way in version
1.1 ...) All other ash descendants seem to have fixed this long ago.

While here, copy a feature from FreeBSD which allows "set +p" (if a
shell run by a setuid process with the -p flag is privileged) to reset
the privileges. Once done (the set +p) it cannot be undone (a later
set -p sets the 'p' flag, but that's all it does) - that just becomes a
one bit storage location.

We do this, as (also copying from FreeBSD, and because it is the right
thing to do) we don't run .profile in a privileged shell - FreeBSD run
/etc/suid_profile in that case (not a good name, it also applies to setgid
shells) but I see no real need for that, we run /etc/profile in any case,
anything that would go in /etc/suid_profile can just go in /etc/profile
instead (with suitable guards so the commands only run in priv'd shells).

One or two minor DEBUG mode changes (notably having priv'd shells identify
themselves in the DEBUG trace) and sh.1 changes with doc of the "set +p"
change, the effect that has on $PSc and a few other wording tweaks.

XXX pullup -9 (not -8, this isn't worth it for the short lifetime
that has left - if it took 28+ years for anyone to notice this, it
cannot be having all that much effect).

show more ...


# 4cb87529 10-Sep-2021 rillig <rillig@NetBSD.org>

bin: remove unnecessary lint comment CONSTCOND

Since 2021-01-31, lint no longer warns about 'do ... while (0)'.

No functional change.


# a672c6e1 22-Jan-2019 kre <kre@NetBSD.org>

NFCI - DEBUG mode only change.

Add tracing of lexical analyser operations. This is deliberately
kept out of the normal "all on" set as it makes a *lot* of noise
when enabled (especially in verbose

NFCI - DEBUG mode only change.

Add tracing of lexical analyser operations. This is deliberately
kept out of the normal "all on" set as it makes a *lot* of noise
when enabled (especially in verbose mode) - but when needed, it
helps (evidence for which is coming soon).

As usual, no doc, you need the sources (and of course, a specially
built sh to even be able to enable it.)

show more ...


# f2dc4639 21-Jan-2019 kre <kre@NetBSD.org>

DEBUG mode shell cleanups (NFC for any normal shell).

Add an error DEBUG trace in exraise() (when the shell has detected
some error or signal, and is aborting what it is doing)

Fix an arith error i

DEBUG mode shell cleanups (NFC for any normal shell).

Add an error DEBUG trace in exraise() (when the shell has detected
some error or signal, and is aborting what it is doing)

Fix an arith error in DEBUG bit assignments (harmless as we haven't
reached the limit of flags yet), and add some missing (recently added)
debug flags so they are turned on when the user (ie: me) asks for
"everything".

show more ...


# a7fa4685 18-Oct-2018 kre <kre@NetBSD.org>

Delete the old style (no longer used) DEBUG mode TRACE compat macro
definitions (just to avoid any temptation to ever use them again).

Update a comment which would make no sense without following th

Delete the old style (no longer used) DEBUG mode TRACE compat macro
definitions (just to avoid any temptation to ever use them again).

Update a comment which would make no sense without following the
preceding comment which is being deleted with the macros it describes.

While here, remove another comment that referred to events that have
long past as if they were still to come. Also a grammatical comment
correction - paragraphs start with capital letters...

NFC (even with DEBUG defined).

show more ...


# bcacfd9a 22-Jul-2018 kre <kre@NetBSD.org>

DEBUG mode only change (ie: no effect to any normal shell).

Add tracing of pattern matching (aid in debugging various issues.)


# 4e19051c 26-Jul-2017 kre <kre@NetBSD.org>

NFC: DEBUG mode change - add a couple more TRACE macros to allow for
conditional (apart from the normal debug conditions) tracing.


# 765053c5 17-Jun-2017 kre <kre@NetBSD.org>

NFC: DEBUG related comment change - catch up with reality.


# 8ffd1099 29-May-2017 kre <kre@NetBSD.org>

More DEBUG mode changes. As usual, read the source if you care.


# 2d8874d9 27-May-2017 kre <kre@NetBSD.org>

More standard (and saner) implementation of the ! reserved word.
Unless the shell is compiled with the (compilation time) option
BOGUS_NOT_COMMAND (as in CFLAGS+=-DBOGUS_NOT_COMMAND) which it
will no

More standard (and saner) implementation of the ! reserved word.
Unless the shell is compiled with the (compilation time) option
BOGUS_NOT_COMMAND (as in CFLAGS+=-DBOGUS_NOT_COMMAND) which it
will not normally be, the ! command (reserved word) will only
be permitted at the start of a pipeline (which includes the
degenerate pipeline with no '|'s in it of course - ie: a simple cmd)
and not in the middle of a pipeline sequence (no "cmd | ! cmd" nonsense.)
If the latter is really required, then "cmd | { ! cmd; }" works as
a standard equivalent.

In POSIX mode, permit only one ! ("! pipeline" is ok. "! ! pipeline" is not).
Again, if needed (and POSIX conformance is wanted) "! { ! pipeline; }"
works as an alternative - and is safer, some shells treat "! ! cmd" as
being identical to "cmd" (this one did until recently.)

show more ...


# 5dd8362a 13-May-2017 kre <kre@NetBSD.org>

The beginnings of the great shell DEBUG (tracing) upgrade of 2017...

First, be aware that the DEBUG spoken of here has nothing whatever to
do with MKDEBUG=true type builds of NetBSD. The only way

The beginnings of the great shell DEBUG (tracing) upgrade of 2017...

First, be aware that the DEBUG spoken of here has nothing whatever to
do with MKDEBUG=true type builds of NetBSD. The only way to get a
DEBUG shell is to build it yourself manually.

That said, for non-DEBUG shells, this change makes only one slight
(trivial really) difference, which should affect nothing.

Previously some code was defined like ...

function(args)
{
#ifdef DEBUG
/* function code goes here */
#endif
}

and called like ...

#ifdef DEBUG
function(params);
#endif

resulting in several empty functions that are never called being
defined in non-DEBUG shells. Those are now gone. If you can detect
the difference any way other than using "nm" or similar, I'd be very
surprised...

For DEBUG shells, this introduces a whole new TRACE() setup to use
to assist in debugging the shell.

I have had this locally (uncommitted) for over a year... it helps.

By itself this change is almost useless, nothing really changes, but
it provides the framework to allow other TRACE() calls to be updated
over time. This is why I had not committed this earlier, my previous
version required a flag day, with all the shell's internal tracing
being updated a once - which I had done, but that shell version has
bit-rotted so badly now it is almost useless...

Future updates will add the mechanism to allow the new stuff to actually
be used in a productive way, and following that, over time, gradual
conversion of all the shell tracing to the updated form (as required,
or when I am bored...)

The one useful change that we do get now is that the fd that the shell
uses for tracing (which was usually 3, but not any more) is now protected
from user/script interference, like all the other shell inernal fds.

There is no doc (nor will there be) on any of this, if you are not reading
the source code it is useless to you, if you are, you know how it works.

show more ...


# cfe71618 21-Mar-2017 joerg <joerg@NetBSD.org>

Add includes guards since we can include the header twice and typedef
redefinitions are a C11 feature.


# 404b1d02 03-May-2016 kre <kre@NetBSD.org>

Fix things so that STATIC can me made static (-DSTATIC=static)
and have the shell still compile, link, and run...

ok christos@


# 7e346d08 28-Apr-2013 dholland <dholland@NetBSD.org>

Add const.


# b5b29542 07-Aug-2003 agc <agc@NetBSD.org>

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.


# e314f958 22-Jan-2003 dsl <dsl@NetBSD.org>

Support command -p, -v and -V as posix
Stop temporary PATH assigments messing up hash table
Fix sh -c -e "echo $0 $*" -a x (as posix)
(agreed by christos)


# edcb4544 27-Sep-2002 christos <christos@NetBSD.org>

VFork()ing shell: From elric@netbsd.org:
Plus my changes:
- walking process group fix in foregrounding a job.
- reset of process group in parent shell if interrupted before the wait.
- move INTON

VFork()ing shell: From elric@netbsd.org:
Plus my changes:
- walking process group fix in foregrounding a job.
- reset of process group in parent shell if interrupted before the wait.
- move INTON lower in the dowait so that the job structure is
consistent.
- error check all setpgid(), tcsetpgrp() calls.
- eliminate unneeded strpgid() call.
- check that we don't belong in the process group before we try to
set it.

show more ...


# 0b398b28 25-May-2002 wiz <wiz@NetBSD.org>

__STDC__ is always defined on NetBSD, so remove #ifdef __STDC__ (and
unnecessary #else cases).


# e6bccfe4 22-May-2000 elric <elric@NetBSD.org>

Back out previous vfork changes.


# a0ef2ea9 13-May-2000 elric <elric@NetBSD.org>

In order to use __NetBSD_Version__, I needed to include sys/param.h.


# 756a2ca1 13-May-2000 elric <elric@NetBSD.org>

Now we use vfork(2) instead of fork(2) when we can.


# 68b1dcea 16-Oct-1996 christos <christos@NetBSD.org>

PR/2808: Don't define DEBUG and #ifdef out functions not needed when DEBUG
is not defined (from FreeBSD).


# 16f5230c 01-Mar-1996 jtc <jtc@NetBSD.org>

Changed so that cd builtin doesn't do wierd stuff when cd'ing through
symlinks. From Chris Demetriou <cgd@NetBSD.ORG>. Fixes PR #1776.

Changed so that INTOFF/INTON are paired in getpwd(). From Ma

Changed so that cd builtin doesn't do wierd stuff when cd'ing through
symlinks. From Chris Demetriou <cgd@NetBSD.ORG>. Fixes PR #1776.

Changed so that INTOFF/INTON are paired in getpwd(). From Matthias
Pfaller <leo@marco.de>. Fixes PR #2130.

show more ...


12