The NetBSD Project

CVS log for src/bin/sh/options.c

[BACK] Up to [cvs.NetBSD.org] / src / bin / sh

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.58 / (download) - annotate - [select for diffs], Sun Sep 18 06:03:19 2022 UTC (4 months, 2 weeks ago) by kre
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.57: +6 -3 lines
Diff to previous 1.57 (colored)

Add the -l option (aka -o login): be a login shell.   Meaningful only on
the command line (with both - and + forms) - overrides the presence (or
otherwise) of a '-' as argv[0][0].

Since this allows any shell to be a login shell (which simply means that
it runs /etc/profile and ~/.profile at shell startup - there are no other
side effects) add a new, always set at startup, variable NBSH_INVOCATION
which has a char string as its value, where each char has a meaning,
more or less related to how the shell was started.   See sh(1).
This is intended to allow those startup scripts to tailor their behaviour
to the nature of this particular login shell (it is possible to detect
whether a shell is a login shell merely because of -l, or whether it would
have been anyway, before the -l option was added - and more).   The
var could also be used to set different values for $ENV for different
uses of the shell.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Apr 16 14:20:45 2022 UTC (9 months, 2 weeks ago) by kre
Branch: MAIN
Changes since 1.56: +6 -6 lines
Diff to previous 1.56 (colored)

Avoid generating error messages implying that user errors are illegal.

Revision 1.53.2.1 / (download) - annotate - [select for diffs], Sat Nov 6 13:35:43 2021 UTC (14 months, 3 weeks ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.53: +9 -2 lines
Diff to previous 1.53 (colored) next main 1.54 (colored)

Pull up following revision(s) (requested by kre in ticket #1371):

	bin/sh/main.c: revision 1.87
	bin/sh/main.c: revision 1.88
	bin/sh/memalloc.h: revision 1.20
	bin/sh/sh.1: revision 1.235
	bin/sh/memalloc.c: revision 1.34
	bin/sh/memalloc.c: revision 1.35
	bin/sh/memalloc.h: revision 1.19
	bin/sh/shell.h: revision 1.31
	bin/sh/options.c: revision 1.56

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).

Use a type-correct end marker for strstrcat() rather than NULL, as
for a function with unknown number & types of args, the compiler isn't
able to automatically convert to the correct type.   Issue pointed out
in off list e-mail by Rolland Illig ... Thanks.

The first arg (pointer to where to put length of result) is of a known
type, so doesn't have the same issue - we can keep using NULL for that
one when the length isn't needed.
Also, make sure to return a correctly null terminated null string in
the (absurd) case that there are no non-null args to strstrcat() (though
there are much better ways to generate "" on the stack).  Since there is
currently just one call in the code, and it has real string args, this
isn't an issue for now, but who knows, some day.

NFCI - if there is any real change, then it is a change that is required.

XXX pullup -9 (together with the previous changes)

Revision 1.56 / (download) - annotate - [select for diffs], Tue Oct 26 00:05:38 2021 UTC (15 months, 1 week ago) by kre
Branch: MAIN
Changes since 1.55: +9 -2 lines
Diff to previous 1.55 (colored)

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).

Revision 1.52.4.4 / (download) - annotate - [select for diffs], Tue Apr 21 19:37:34 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.52.4.3: +2 -2 lines
Diff to previous 1.52.4.3 (colored) to branchpoint 1.52 (colored) next main 1.53 (colored)

Ooops, restore accidently removed files from merge mishap

Revision 1.52.4.3, Tue Apr 21 18:41:06 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.52.4.2: +2 -2 lines
FILE REMOVED

Sync with HEAD

Revision 1.52.4.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:03:04 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.52.4.1: +11 -3 lines
Diff to previous 1.52.4.1 (colored) to branchpoint 1.52 (colored)

Merge changes from current as of 20200406

Revision 1.55 / (download) - annotate - [select for diffs], Wed Feb 5 14:56:25 2020 UTC (2 years, 11 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.54: +4 -2 lines
Diff to previous 1.54 (colored)


Oops, the previous didn't do what was promised.  Rather that ignoring
just "--" for exec & "." it ignored any first arg starting '-'.
Do it properly.

Revision 1.54 / (download) - annotate - [select for diffs], Tue Feb 4 16:06:59 2020 UTC (2 years, 11 months ago) by kre
Branch: MAIN
Changes since 1.53: +9 -3 lines
Diff to previous 1.53 (colored)

After bug report 262 (from 2010)
	https://austingroupbugs.net/view.php?id=252
the Austin Group decided to require processing of "--" by the "."
and "exec" commands to solve a problem where some shells did
option processing for those commands (permitted) and others did
not (also permitted) which left no safe way to process a file
with a name beginning with "-".

This has finally made its way into what will be the next version of
the POSIX standard.

Since this shell did no option processing at all for those commands,
we need to update.   This is that update.

The sole effect is that a "--" 'option' (to "." or "exec") is ignored.
This means that if you want to use "--" as the arg to one of those
commands, it needs to be given twice ". -- --".   Apart from that there
should be no difference at all (though the "--" can now be used in other
situations, where we did not require it before, and still do not).

Revision 1.52.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 21:41:04 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.52: +9 -3 lines
Diff to previous 1.52 (colored)

Sync with HEAD

Revision 1.49.2.1 / (download) - annotate - [select for diffs], Sat Aug 25 14:45:37 2018 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.49: +9 -3 lines
Diff to previous 1.49 (colored) next main 1.50 (colored)

Pull up following revision(s) (requested by kre in ticket #988):

	bin/sh/parser.c: revision 1.147
	bin/sh/var.c: revision 1.70
	bin/sh/mystring.c: revision 1.18
	bin/sh/options.c: revision 1.53
	bin/sh/histedit.c: revision 1.53

Remove atoi()

Mostly use number() (no longer implemented using atoi()) when an
unsigned integer is required, but use strtoXXX() when a conversion
is wanted, without the possibility or error (like setting OPTIND
and RANDOM).   Always init OPTIND to 1 when sh starts (overriding
anything in environ.)

Revision 1.52.2.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:32:56 2018 UTC (4 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.52: +9 -3 lines
Diff to previous 1.52 (colored) next main 1.53 (colored)

Sync with HEAD

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jul 13 22:43:44 2018 UTC (4 years, 6 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, netbsd-9-base, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: netbsd-9
Changes since 1.52: +9 -3 lines
Diff to previous 1.52 (colored)

Remove atoi()

Mostly use number() (no longer implemented using atoi()) when an
unsigned integer is required, but use strtoXXX() when a conversion
is wanted, without the possibility or error (like setting OPTIND
and RANDOM).   Always init OPTIND to 1 when sh starts (overriding
anything in environ.)

Revision 1.52 / (download) - annotate - [select for diffs], Tue Nov 21 03:42:39 2017 UTC (5 years, 2 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.51: +8 -2 lines
Diff to previous 1.51 (colored)

Remove the -X option from SMALL shells (as used on boot floppies,
some other install media, mini-roots, etc.)   It is unlikely that
such a shell will be used for much script debugging (and the old -x
still exists of course) and it adds a little bloat, so, zap...

The ancient unused (unrelated) xioctl() function is gone as well
(from all shells).

Revision 1.51 / (download) - annotate - [select for diffs], Sun Nov 19 03:23:01 2017 UTC (5 years, 2 months ago) by kre
Branch: MAIN
Changes since 1.50: +10 -4 lines
Diff to previous 1.50 (colored)

Implement the -X option - an apparent variant of -x which sends all trace
output to the stderr which existed when the -X option was (last) enabled.
It also enables tracing by enabling -x (and when reset, +X, also resets
the 'x' flag (+x)).  Note that it is still -x/+x which actually
enables/disables the trace output.   Hence "apparent variant" - what -X
actually does (aside from setting -x) is just to lock the trace output,
rather than having it follow wherever stderr is later redirected.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jul 24 12:35:37 2017 UTC (5 years, 6 months ago) by kre
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

PR standards/52406

Absent other information, the shell should be interactive if reading
from stdin, and stdin and stderr are ttys, not stdin and stdout.

So sayeth the great lord posix.

Revision 1.49 / (download) - annotate - [select for diffs], Mon May 29 14:03:23 2017 UTC (5 years, 8 months ago) by kre
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)


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

Revision 1.46.6.1 / (download) - annotate - [select for diffs], Fri May 19 00:22:51 2017 UTC (5 years, 8 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.46: +62 -14 lines
Diff to previous 1.46 (colored) next main 1.47 (colored)

Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)

Revision 1.48 / (download) - annotate - [select for diffs], Thu May 18 13:53:18 2017 UTC (5 years, 8 months ago) by kre
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.47: +52 -14 lines
Diff to previous 1.47 (colored)


Command line, and "set" command options processing cleanup.

sh +c "command string"	no longer works (it must be -c)
sh +o   and   sh -o	no longer work (if you could call what they did
			before working.)  nb: this is without an option name.
-ooo Opt1 Opt2 Opt3	no longer works (set & cmd line), this should be
			-o Opt1 -o Opt2 -o Opt3   (same with +ooo of course).
-oOpt			is now supported - option value (name of option in
			this case) immediately following -o (or +o).
			(as with other commands that use std opt parsing)
			Both set comamnd and command line.

In addition, the output from "set +o" has shrunk dramatically, by borrowing
a trick from ksh93 (but implemented in a more traditional syntax).
"set +o" is required to produce a command (or commands) which when executed
later, will return all options to the state they were in when "set +o"
was done.  Previously that was done by generating a set command, with
every option listed (set -o opt +o other-opt ...) to set them all back
to their current setings.   Now we have a new "magic option" ("default")
which sets all options to their default values, so now set +o output
need only be "set -o default -o changed-opt ..." (only the options that
have been changed from their default values need be explicitly mentioned.)
The definition of "default value" for this is the value the shell set the
option to, after startup, after processing the command line (with any
flags, or -o option type settings), but before beginning processing any
user input (incuding startup files, like $ENV etc).

Anyone can execute "set -o default" of course, but only from a "set"
command (it makes no sense at all as a -o option to sh).   This also
causes "set +o" to be slightly more useful as a general command, as
ignoring the "set -o default" part of the result, it lists just those
options that have been altered after sh startup.  There is no +o default.
There isn't an option called "default" at all...

This causes some of the commented out text from sh.1 to become uncommented.

Revision 1.47 / (download) - annotate - [select for diffs], Mon May 15 20:00:36 2017 UTC (5 years, 8 months ago) by kre
Branch: MAIN
Changes since 1.46: +12 -2 lines
Diff to previous 1.46 (colored)


DEBUG mode shell update (changes nothing for shells which are not
compiled for DEBUG.)

Add debug builtin command, and corresponding -D command line option.
As usual, for DEBUG related stuff, read the source for info, that's
all there is about this.

This completes the infrastructure changes for the updated DEBUG TRACE
mechanism, so now converting the rest of the shell's internal tracing
can happen as desired - piecemeal.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Mar 31 16:16:35 2016 UTC (6 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2
Changes since 1.45: +23 -8 lines
Diff to previous 1.45 (colored)

Implement the NETBSD_SHELL readonly unexportable unimportable
variable (with its current value set at 20160401) as discussed on
current-users and tech-userlevel. This also includes the necessary
support to implement it properly (particularly the unexportable
part) and adds options to the export command to support unexportable
variables. Also implement the "posix" option (no single letter
equivalent) which gets its default value from whether or not
POSIXLY_CORRECT is set in the environment when the shell starts
(but can be changed just like any other option using -o and +o on
the command line, or the set builtin command.) While there, fix
all uses of options so it is possible to have options that have a
short (one char) name, and no long name, just as it has been possible
to have options with a long name and no short name, though there
are currently none (with no long name).  For now, the only use of
the posix option is to control whether ${ENV} is read at startup
by a non-interactive shell, so changing it with set is not usful
- that might change in the future. (from kre@)

Revision 1.45 / (download) - annotate - [select for diffs], Tue Mar 8 14:08:39 2016 UTC (6 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.44: +6 -3 lines
Diff to previous 1.44 (colored)

PR bin/50896: make shift with more than 1 arg give a usage message, from kre

Revision 1.44 / (download) - annotate - [select for diffs], Wed Feb 24 14:38:40 2016 UTC (6 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.43: +6 -2 lines
Diff to previous 1.43 (colored)

If we don't have shared address space vfork fail back to using fork since
we are depending on the shared address space feature (from kre)

Revision 1.42.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:01:38 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.42: +3 -4 lines
Diff to previous 1.42 (colored) next main 1.43 (colored)

sync with head

Revision 1.43 / (download) - annotate - [select for diffs], Tue Mar 20 18:42:29 2012 UTC (10 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, khorben-n900, agc-symver-base, agc-symver
Changes since 1.42: +3 -4 lines
Diff to previous 1.42 (colored)

Use C89 function definitions

Revision 1.41.6.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:17:48 2011 UTC (11 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jun 18 21:18:46 2011 UTC (11 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: yamt-pagecache
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored)

PR/45069: Henning Petersen: Use prototypes from builtins.h .

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 18 00:30:54 2009 UTC (14 years ago) by lukem
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, cherry-xenmp-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: cherry-xenmp
Changes since 1.40: +7 -7 lines
Diff to previous 1.40 (colored)

fix -Wsign-compare issues

Revision 1.40 / (download) - annotate - [select for diffs], Tue Dec 13 17:44:18 2005 UTC (17 years, 1 month ago) by dsl
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, mjf-devfs2-base, mjf-devfs2, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.39: +16 -6 lines
Diff to previous 1.39 (colored)

TOG require that 'set +o' output the options in a form suitable for
restoring them - make it so.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jul 15 17:46:54 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.38: +4 -2 lines
Diff to previous 1.38 (colored)

If we have a script and we are interactive, set interactive to 2. This
allows us to run scripts with -i without printing the prompt like the
other shells do.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Mar 20 21:38:17 2005 UTC (17 years, 10 months ago) by dsl
Branch: MAIN
Changes since 1.37: +4 -3 lines
Diff to previous 1.37 (colored)

Add 'continue' as body of empty loop.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Oct 30 19:29:27 2004 UTC (18 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.36: +5 -3 lines
Diff to previous 1.36 (colored)

Pass WARNS=3

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jan 5 23:23:32 2004 UTC (19 years, 1 month ago) by jmmv
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Aug 7 09:05:36 2003 UTC (19 years, 6 months ago) by agc
Branch: MAIN
Changes since 1.34: +3 -7 lines
Diff to previous 1.34 (colored)

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

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

Revision 1.34 / (download) - annotate - [select for diffs], Tue Apr 15 07:40:56 2003 UTC (19 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

%d is 12 chars, not 10 chars.  hinted by deraadt

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jan 22 20:36:04 2003 UTC (20 years ago) by dsl
Branch: MAIN
Changes since 1.32: +10 -15 lines
Diff to previous 1.32 (colored)

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)

Revision 1.32 / (download) - annotate - [select for diffs], Sun Nov 24 22:35:42 2002 UTC (20 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.31: +56 -64 lines
Diff to previous 1.31 (colored)

Fixes from David Laight:
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
  (so I could unset -e PS1 before running the test shell...)

Revision 1.31 / (download) - annotate - [select for diffs], Mon Feb 26 13:06:43 2001 UTC (21 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, ELRICshvfork-base, ELRICshvfork
Changes since 1.30: +6 -4 lines
Diff to previous 1.30 (colored)

Fix command name in error message for 'sh nonexistingfile'.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Feb 4 19:52:06 2001 UTC (22 years ago) by christos
Branch: MAIN
Changes since 1.29: +4 -4 lines
Diff to previous 1.29 (colored)

remove redundant declarations and nexted externs.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Jul 9 03:05:50 1999 UTC (23 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.28: +11 -10 lines
Diff to previous 1.28 (colored)

compile with WARNS = 2

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jul 28 11:41:57 1998 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

Be more retentive about use of NOTREACHED and noreturn.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jul 28 05:31:28 1998 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

Delint.

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Fri May 8 06:01:04 1998 UTC (24 years, 9 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Sync with trunk, per request of christos.

Revision 1.26 / (download) - annotate - [select for diffs], Sat May 2 18:04:09 1998 UTC (24 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

PR/5315: Dan Winship: options parsing code should print errors to stderr.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jul 4 21:02:16 1997 UTC (25 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Branch point for: netbsd-1-3
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

Fix compiler warnings.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Mar 14 01:42:22 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

NO_HISTORY->SMALL

Revision 1.14.6.2 / (download) - annotate - [select for diffs], Tue Mar 4 15:18:14 1997 UTC (25 years, 11 months ago) by mycroft
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.14.6.1: +3 -3 lines
Diff to previous 1.14.6.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

Pull up latest sh(1).  Fixes yet more bugs.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 25 17:51:50 1997 UTC (25 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Fix PR/3258 sh -c 'echo $0' causes segmentation fault.

Revision 1.14.6.1 / (download) - annotate - [select for diffs], Sun Jan 26 04:57:32 1997 UTC (26 years ago) by rat
Branch: netbsd-1-2
Changes since 1.14: +117 -35 lines
Diff to previous 1.14 (colored)

Update /bin/sh from trunk per request of Christos Zoulas.  Fixes
many bugs.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jan 11 02:04:43 1997 UTC (26 years ago) by tls
Branch: MAIN
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored)

kill 'register'

Revision 1.21 / (download) - annotate - [select for diffs], Sun Dec 15 20:37:09 1996 UTC (26 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

Getopts bugs again (I'll never get this right).
- make sure that OPTIND is set correctly even in the absence of options.
- don't keep stale state between getopts calls.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 24 20:48:01 1996 UTC (26 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Fix bug in getopts code where the argument list got truncated.
From Todd Miller.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 6 01:17:11 1996 UTC (26 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.18: +15 -8 lines
Diff to previous 1.18 (colored)

Fix miscellaneous getopts problems:
- the 3 argument version of getopts would not reset properly
- OPTARG did not get cleared after a non argument option was found
- OPTIND was not set properly after a non argument option.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Nov 2 18:26:05 1996 UTC (26 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Fix problems that gcc -Wall found (from Todd Miller, OpenBSD)

Revision 1.17 / (download) - annotate - [select for diffs], Wed Oct 16 14:49:56 1996 UTC (26 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.16: +12 -8 lines
Diff to previous 1.16 (colored)

PR/2808: POSIX 1003.2: first arg after -c cmd is $0, remainder $1...
	 (from FreeBSD)

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jun 25 16:47:43 1996 UTC (26 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.15: +33 -11 lines
Diff to previous 1.15 (colored)

- Add getoptsreset to be used as a callback function when OPTIND is set.
  This is used to implement the POSIX behavior when OPTIND=1
- Call setvarsafe instead of setvar. If one ran
	"getopts optstr badvariable"
  where badvariable contained an illegal variable name, there was no way
  to recover, since setvar() would longjmp on the error.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jun 4 21:00:09 1996 UTC (26 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.14: +72 -24 lines
Diff to previous 1.14 (colored)

getopts fixes:

1. OPTIND value was not computed correctly when the argument was part of the
   option string (i.e. for "l:" "-l 1" was working "-l1" was not). (PR/2505).
2. OPTARG was not being unset in case of errors [in the non POSIX error case].
3. optvar could be set to random values.
4. Option string starting with a : was not treated specially as POSIX
   specifies (if the option string starts with a :, then there is no
   error printed when there are missing option arguments or illegal options,
   and OPTARG and optvar are being set specially).
5. Implemented getopts "opts" optvar [arg]. The optional argument case
   was not implemented.

To do:
- what does Posix say about resetting the getopts state? Bash does it
  by setting OPTIND=0; is that correct? Should we be doing the same thing?
- should we be using getopt(3) for everything internal to the shell? Is that
  feasible because we might need to handle multiple invocations at once.

Revision 1.14 / (download) - annotate - [select for diffs], Thu May 11 21:29:46 1995 UTC (27 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Branch point for: netbsd-1-2
Changes since 1.13: +14 -17 lines
Diff to previous 1.13 (colored)

Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0
bug.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 26 17:25:10 1995 UTC (27 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.12: +4 -7 lines
Diff to previous 1.12 (colored)

Reverted to set - turning off -x and -v. Charles corrected me... It is part
of POSIX.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 25 23:45:24 1995 UTC (27 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.11: +7 -4 lines
Diff to previous 1.11 (colored)

set -
does not anymore clear the -x and -v flags. This was incompatible with
all other bourne shell implementations.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Mar 21 09:09:51 1995 UTC (27 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.10: +7 -2 lines
Diff to previous 1.10 (colored)

convert to new RCS id conventions.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 5 19:07:46 1994 UTC (28 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.9: +22 -6 lines
Diff to previous 1.9 (colored)

clean up further.  more patches from Jim Jegers

Revision 1.9 / (download) - annotate - [select for diffs], Sun Dec 4 07:12:26 1994 UTC (28 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored)

from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 11 16:12:23 1994 UTC (28 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

Add RCS ids.

Revision 1.7 / (download) - annotate - [select for diffs], Sat May 14 22:20:23 1994 UTC (28 years, 8 months ago) by cgd
Branch: MAIN
Changes since 1.6: +2 -0 lines
Diff to previous 1.6 (colored)

add back in support for building w/o obj dir.  also, add NO_HISTORY
define, which (if you invoke mkbuiltins properly) gets you a sh w/o
history of command line editing (for floppy sh).

Revision 1.6 / (download) - annotate - [select for diffs], Thu May 12 17:03:47 1994 UTC (28 years, 8 months ago) by jtc
Branch: MAIN
Changes since 1.5: +1 -0 lines
Diff to previous 1.5 (colored)

Include appropriate header files to bring function prototypes into scope.

Revision 1.5 / (download) - annotate - [select for diffs], Wed May 11 17:10:31 1994 UTC (28 years, 9 months ago) by jtc
Branch: MAIN
Changes since 1.4: +70 -26 lines
Diff to previous 1.4 (colored)

sync with 4.4lite

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Wed May 11 17:01:21 1994 UTC (28 years, 9 months ago) by jtc
Branch: WFJ-920714, CSRG
CVS Tags: lite-1
Changes since 1.1.1.1: +70 -25 lines
Diff to previous 1.1.1.1 (colored)

44lite code

Revision 1.4 / (download) - annotate - [select for diffs], Sun Aug 1 18:58:04 1993 UTC (29 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Add RCS identifiers.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Mar 23 00:29:01 1993 UTC (29 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

changed "Id" to "Header" for rcsids

Revision 1.2 / (download) - annotate - [select for diffs], Mon Mar 22 08:04:00 1993 UTC (29 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

added rcs ids to all files

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (29 years, 10 months ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (29 years, 10 months ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>