freebsd-skq/bin
Jilles Tjoelker 484160a9cf 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
2019-02-24 21:05:13 +00:00
..
cat
chflags
chio
chmod
cp
csh Don't mess with BLOCKSIZE in shell startup files - it's set by login.conf(5); 2019-01-20 22:08:49 +00:00
date Remove, the now very outdated, timed. 2018-12-15 21:34:40 +00:00
dd Replace hand-crafted naive byte-by-byte zero block detection routine 2018-11-29 19:28:01 +00:00
df
domainname
echo
ed Drop ed(1) "crypto" 2018-11-04 17:56:16 +00:00
expr
freebsd-version
getfacl Avoid copying a struct stat for acl_from_stat() calls. 2018-11-01 17:45:29 +00:00
hostname
kenv
kill
ln
ls
mkdir
mv
pax Add a note that the use of -B option does not guarantee a size of fragment 2018-12-29 23:08:59 +00:00
pkill Clarify that /dev/kmem is not used. 2018-12-03 20:01:51 +00:00
ps ps(1): Pet mandoc and igor 2018-10-31 17:47:08 +00:00
pwait
pwd
realpath
rm rm(1): Formalize non-functional status of -P flag 2018-11-10 20:26:55 +00:00
rmail
rmdir
setfacl Don't set NFSv4 ACL inheritance flags on non-directories. 2018-10-26 21:17:06 +00:00
sh sh: Add set -o pipefail 2019-02-24 21:05:13 +00:00
sleep
stty stty.1: Document kern.tty_info_kstacks behavior (r339471) 2018-10-20 18:53:32 +00:00
sync
test
tests
uuidgen
Makefile
Makefile.inc