#
345561 |
|
26-Mar-2019 |
jilles |
MFC r344502: sh: Add set -o pipefail
The pipefail option allows checking the exit status of all commands in a pipeline more easily, at a limited cost of complexity in sh itself. It works similarly to the option in bash, ksh93 and mksh.
Like ksh93 and unlike bash and mksh, the state of the option is saved when a pipeline is started. Therefore, even in the case of commands like A | B & a later change of the option does not change the exit status, the same way (A | B) & works.
Since SIGPIPE is not handled specially, more work in the script is required for a proper exit status for pipelines containing commands such as head that may terminate successfully without reading all input. This can be something like
( cmd1 r=$? if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then exit 0 else exit "$r" fi ) | head
PR: 224270 Relnotes: yes
|
#
331722 |
|
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re)
|
#
330897 |
|
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg
|
#
302408 |
|
07-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
294348 |
|
19-Jan-2016 |
jilles |
sh: Simplify some code related to positional parameters.
|
#
293392 |
|
07-Jan-2016 |
jilles |
sh: Reduce size of options table.
|
#
287296 |
|
29-Aug-2015 |
jilles |
sh: Add set -o nolog.
POSIX requires this to prevent entering function definitions in history but this implementation does nothing except retain the option's value. In ksh88, function definitions were usually entered in the history file, even when they came from ~/.profile and the $ENV file, to allow displaying their definitions.
This is also the first option that does not have a letter.
|
#
279503 |
|
01-Mar-2015 |
jilles |
sh: Fix compiler warnings related to duplicate or missing declarations.
|
#
273700 |
|
26-Oct-2014 |
jilles |
sh: Make getopts memory-safe if with changing arguments.
POSIX does not permit to continuing a getopts loop with different arguments. For parsing the positional parameters, we handle this case by resetting the getopts state when the positional parameters are changed in any way (and the getopts state is local to a function). However, in the syntax getopts <optstring> <var> <arg...>, changes could lead to invalid memory access.
In the syntax getopts <optstring> <var> <arg...>, store a copy of the arguments and continue to use them until getopts is reset.
|
#
223281 |
|
18-Jun-2011 |
jilles |
sh: Add do-nothing -h option.
POSIX requires a -h option to sh and set, to locate and remember utilities invoked by functions as they are defined. Given that this locate-and-remember process is optional elsewhere, it seems safe enough to make this option do nothing.
POSIX does not specify a long name for this option. Follow ksh in calling it "trackall".
|
#
223060 |
|
13-Jun-2011 |
jilles |
sh: Fix duplicate prototypes for builtins.
Have mkbuiltins write the prototypes for the *cmd functions to builtins.h instead of builtins.c and include builtins.h in more .c files instead of duplicating prototypes for *cmd functions in other headers.
|
#
201053 |
|
27-Dec-2009 |
jilles |
sh: Various warning fixes (from WARNS=6 NO_WERROR=1): - const - initializations to silence -Wuninitialized (it was safe anyway) - remove nested extern declarations - rename "index" locals to "idx"
|
#
200956 |
|
24-Dec-2009 |
jilles |
sh: Constify various strings.
Most of this is adding const keywords, but setvar() in var.c had to be changed somewhat more.
|
#
127958 |
|
06-Apr-2004 |
markm |
Remove clause 3 from the UCB licenses.
OK'ed by: imp, core
|
#
100664 |
|
25-Jul-2002 |
tjr |
Add a -P/-o physical option which behaves similarly to bash/ksh's options by the same name. This option makes the cd and pwd builtins behave physically (as opposed to logically) by default.
Submitted by: fanf
|
#
90111 |
|
02-Feb-2002 |
imp |
o __P has been reoved o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ...
|
#
59436 |
|
20-Apr-2000 |
cracauer |
Fix warnings, some of them serious because sh violated name spaces reserved by the header files it includes.
mkinit.c still produces C code with redundant declarations, although they are more harmless since they automatically derived from the right places.
|
#
50471 |
|
27-Aug-1999 |
peter |
$Id$ -> $FreeBSD$
|
#
45221 |
|
01-Apr-1999 |
cracauer |
The immediate execution of traps I introduced in September 1998 (to make /etc/rc interruptible in cases when programs hang with blocked signals) isn't standard enough.
It is now switched off by default and a new switch -T enables it.
You should update /etc/rc to the version I'm about to commit in a few minutes to keep it interruptible.
|
#
22988 |
|
22-Feb-1997 |
peter |
Revert $FreeBSD$ to $Id$
|
#
21673 |
|
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
|
#
20425 |
|
14-Dec-1996 |
steve |
Merge in NetBSD mods and -Wall cleaning.
Obtained from: NetBSD, me
|
#
19240 |
|
29-Oct-1996 |
steve |
Add the -p (privileged) commandline switch found in bash, zsh, and friends.
Reviewed by: joerg
|
#
17987 |
|
01-Sep-1996 |
peter |
Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a merge of parallel duplicate work by Steve Price and myself. :-]
There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes.
This closes a pile of /bin/sh PR's, but not all of them..
Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
|
#
3044 |
|
24-Sep-1994 |
dg |
Added $Id$
|
#
1557 |
|
26-May-1994 |
rgrimes |
This commit was generated by cvs2svn to compensate for changes in r1556, which included commits to RCS files with non-trunk default branches.
|
#
1556 |
|
26-May-1994 |
rgrimes |
BSD 4.4 Lite bin Sources
|