blob: 773f7a5da07c35979a52fd052d5368d00120c7ed (
plain)
- #!/bin/sh
- #
- # Copyright © 2021 Jonas Smedegaard <dr@jones.dk>
- # Description: pipe a command to less with INT signal blocked
- #
- # This program is free software;
- # you can redistribute it and/or modify it
- # under the terms of the GNU General Public License
- # as published by the Free Software Foundation;
- # either version 2, or (at your option) any later version.
- #
- # Thanks to Jakub Wilk <jwilk@debian.org> for the trick
- #
- # Depends: less
- set -e
- PRG=$(basename "$0")
- showhelp() {
- cat <<EOF
- Usage: $PRG command [opetions...]
- Example: $PRG journalctl -ef
- EOF
- }
- exit1() {
- echo "ERROR: $1"
- exit 1
- }
- if [ $# -eq 0 ]; then
- showhelp
- exit1 "not enough parameters"
- fi
- exec env --ignore-signal=INT "$@" | less
|