I'd bumped from -blength to --blength in
abee64c4 (.bashrc.d/20nobeep:
Change '-blength' -> '--blength', 2015-03-19), expecting to never see
util-linux < 2.25 or so again. But I've recently been exposed to a
RHEL 7.5 system, which has:
$ setterm -version
setterm from util-linux 2.23.2
$ setterm --help 2>&1 | grep blength
-blength <0-2000>
so this commit adds code to attempt the single-dash form if the
double-dash form fails.
# turn of terminal beeps in the console, unless connecting via SSH
if [ -n "$TERM" ] && [ -z "$SSH_CLIENT" ]; then
- setterm --blength 0
+ setterm --blength 0 2>/dev/null || setterm -blength 0
fi
# turn off beeps in Firefox