MANPAGER="grep -F {" man systemd.exec leads to man: command exited with status 1: sed -e ...
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
man-db (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Hello, I wanted to search the systemd.exec(5) manpage for an opening brace character, {, in a manner that would be easy to copy-and-paste the results if there were any. This unfortunately gives an error message:
$ MANPAGER="grep -F {" man systemd.exec
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:
$ MANPAGER="grep -F {" man apparmor
$
It works fine on a simple example, apparmor(7). Other patterns work with systemd.exec(5):
$ MANPAGER="grep -F aa" man systemd.exec
then the environment variable "RUNTIME_DIRECTORY" is set with "/run/foo/bar", and "STATE_DIRECTORY" is set with "/var/lib/
$
Thus I think when the pager doesn't provide any output we get an ugly error message. I expected no output at all if the pattern doesn't match.
Thanks
And now the --debug output:
$ MANPAGER="grep -F {" man --debug -s 5 systemd.exec
ruid=1000, euid=1000
rgid=1000, egid=1000
++priv_drop_count = 1
From the config file /etc/manpath.
Mandatory mandir `/usr/man'.
Mandatory mandir `/usr/share/man'.
Mandatory mandir `/usr/local/
Path `/bin' mapped to mandir `/usr/share/man'.
Path `/usr/bin' mapped to mandir `/usr/share/man'.
Path `/sbin' mapped to mandir `/usr/share/man'.
Path `/usr/sbin' mapped to mandir `/usr/share/man'.
Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
Path `/usr/local/bin' mapped to mandir `/usr/local/
Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
Path `/usr/local/sbin' mapped to mandir `/usr/local/
Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
Path `/usr/games' mapped to mandir `/usr/share/man'.
Path `/opt/bin' mapped to mandir `/opt/man'.
Path `/opt/sbin' mapped to mandir `/opt/man'.
Global mandir `/usr/man', catdir `/var/cache/
Global mandir `/usr/share/man', catdir `/var/cache/man'.
Global mandir `/usr/local/man', catdir `/var/cache/
Global mandir `/usr/local/
Global mandir `/usr/X11R6/man', catdir `/var/cache/
Global mandir `/opt/man', catdir `/var/cache/
Global mandir `/snap/man', catdir `/var/cache/
Added sections: `1', `n', `l', `8', `3', `2', `3posix', `3pm', `3perl', `3am', `5', `4', `9', `6', `7'.
is a tty
using grep -F { as pager
path directory /home/sarnold/bin is not in the config file
path directory /usr/local/sbin is in the config file
adding /usr/local/man to manpath
adding /usr/local/
path directory /usr/local/bin is in the config file
path directory /usr/sbin is in the config file
adding /usr/share/man to manpath
path directory /usr/bin is in the config file
path directory /sbin is in the config file
path directory /bin is in the config file
path directory /usr/games is in the config file
path directory /usr/local/games is not in the config file
path directory /snap/bin is not in the config file
adding mandatory man directories
warning: /usr/man: No such file or directory
add_nls_manpaths(): processing /usr/local/
checking for locale en_US.UTF-8
adding /usr/local/man to manpathlist
adding /usr/share/man to manpathlist
final search path = /usr/local/
--priv_drop_count = 0
searching in /usr/local/man, section 5
trying section 5 with globbing
Layout is GNU (1)
update_
globbing pattern in /usr/local/man: man5*
update_
globbing pattern in /usr/local/man: cat5*
Failed to open /var/cache/
searching in /usr/share/man, section 5
trying section 5 with globbing
update_
globbing pattern in /usr/share/man: man5*
matched: /usr/share/man/man5
update_
globbing pattern in /usr/share/
matched: /usr/share/
ult_src: File /usr/share/
loading seccomp filter (permissive: 0)
candidate: 0 0 systemd.exec /usr/share/man /usr/share/
Checking physical location: /usr/share/
ult_src: File /usr/share/
loading seccomp filter (permissive: 0)
found ultimate source file /usr/share/
converted /usr/share/
is_changed: a=/usr/
converted /var/cache/
will try cat file /var/cache/
loading seccomp filter (permissive: 0)
pre-processors `t' from file
page_encoding = ISO-8859-1
source_encoding = ISO-8859-1
locale_charset = UTF-8
roff_device (locale) = utf8
roff_encoding = ISO-8859-1
output_encoding = UTF-8
less_charset = utf-8
Terminal width 172
Terminal width 172 not within cat page range [80, 80]
Using 167-character lines
formatted_encoding = UTF-8
format: 1, save_cat: 0, found: 1
add_output_iconv: source UTF-8, target UTF-8
Setting LESS to -ix8RmPm Manual page systemd\.exec(5) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page systemd\.exec(5) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$
Setting MAN_PN to systemd\.exec(5)
++priv_drop_count = 1
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:
$
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: man-db 2.9.1-1
ProcVersionSign
Uname: Linux 5.4.0-74-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Wed Jun 16 00:15:22 2021
SourcePackage: man-db
UpgradeStatus: Upgraded to focal on 2020-01-24 (508 days ago)
Changed in man-db (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
The problem with fixing this as you describe ("no output at all") is that it would make it difficult to understand what's going on in the more common case where your configured pager is accidentally not installed. Would you accept a less ugly error message (somehow)?