Date: Fri, 08 Dec 2017 09:18:34 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223516] man(1) ignores the exit status of groff Message-ID: <bug-223516-8-bwHPwt56pV@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-223516-8@https.bugs.freebsd.org/bugzilla/> References: <bug-223516-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223516 Wolfram Schneider <wosch@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Open CC| |wosch@FreeBSD.org Assignee|wosch@FreeBSD.org |freebsd-bugs@FreeBSD.org --- Comment #1 from Wolfram Schneider <wosch@FreeBSD.org> --- I think the problem is in the function line 456: 456 eval "$cattool $manpage | $pipeline" 457 ret=3D$? we are checking only the status of the last command, which is the $PAGER (e= .g. less(1)) eval '/usr/bin/zcat /home/wosch/man/man7/salt.7.gz | tbl | groff -S -P-h -W= all -mtty-char -man -Tascii -P-c | less' and ignore the exit status of groff (and tbl, zcat - any command in the pipeline) The bash has an option to fail on pipe errors $ set -o pipefail unfortunately, our /bin/sh implementation does not have this feature. There are workaround for shell which don=E2=80=99t check the pipe status, a= s described in https://unix.stackexchange.com/questions/14270/get-exit-status-of-process-t= hats-piped-to-another (((((exec 3>&- 4>&-; someprog); echo $? >&3) | filter >&4) 3>&1) | (read xs; exit $xs)) 4>&1 but this looks bizarre and you have to do it for every command in the pipe line. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223516-8-bwHPwt56pV>