From 75b4abb380319a277d733bc899ff898457b8018c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 11 Jul 2018 15:24:54 -0700 Subject: [PATCH] .bashrc.d/20nobeep: Fallback to -blength if --blength doesn't work 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. --- src/.bashrc.d/20nobeep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.bashrc.d/20nobeep b/src/.bashrc.d/20nobeep index 6e6176f..e6587ed 100644 --- a/src/.bashrc.d/20nobeep +++ b/src/.bashrc.d/20nobeep @@ -7,7 +7,7 @@ fi # 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 -- 2.26.2