From e78351244a9e4e4ec2c6aa56404afeeb9687d134 Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:01:18 -0400 Subject: [PATCH] Remove bashisms from disable monitor (#472) Co-authored-by: nnyyxxxx --- tabs/utils/monitor-control/disable_monitor.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tabs/utils/monitor-control/disable_monitor.sh b/tabs/utils/monitor-control/disable_monitor.sh index a1eafc52..8a400701 100755 --- a/tabs/utils/monitor-control/disable_monitor.sh +++ b/tabs/utils/monitor-control/disable_monitor.sh @@ -20,7 +20,8 @@ disable_monitor() { i=$((i + 1)) done - read -p "Enter the number of the monitor: " monitor_choice + printf "%b\n" "Enter the number of the monitor: " + read -r monitor_choice if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then printf "%b\n" "${RED}Invalid selection.${RC}" @@ -44,7 +45,8 @@ disable_monitor() { confirm_action() { action="$1" printf "%b\n" "${YELLOW}$action${RC}" - read -p "Are you sure? (y/n): " confirm + printf "%b\n" "Are you sure? (y/n): " + read -r confirm if echo "$confirm" | grep -qE '^[Yy]$'; then return 0 else