This is more readable than nested command substitution. We already
require bash(1) for ${!#}, so we can abuse it a little bit more.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
# SPDX-License-Identifier: GPL-3.0-or-later
set -Eeuo pipefail;
+shopt -s lastpipe;
-tmp="$(mktemp -t "$(printf '%s\n' "${!#}" | sed 's,.*/,,').XXXXXX")";
+printf '%s\n' "${!#}.XXXXXX" \
+| sed 's,.*/,,' \
+| xargs mktemp -t \
+| read -r tmp;
man -Tpdf "$@" >"$tmp";
xdg-open "$tmp";