Skip to content

Commit fce63c1

Browse files
author
nnyyxxxx
committed
Remove bashisms from disable monitor
1 parent 719548f commit fce63c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tabs/utils/monitor-control/disable_monitor.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ disable_monitor() {
2020
i=$((i + 1))
2121
done
2222

23-
read -p "Enter the number of the monitor: " monitor_choice
23+
printf "%b\n" "Enter the number of the monitor: "
24+
read -r monitor_choice
2425

2526
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then
2627
printf "%b\n" "${RED}Invalid selection.${RC}"
@@ -44,7 +45,8 @@ disable_monitor() {
4445
confirm_action() {
4546
action="$1"
4647
printf "%b\n" "${YELLOW}$action${RC}"
47-
read -p "Are you sure? (y/n): " confirm
48+
printf "%b\n" "Are you sure? (y/n): "
49+
read -r confirm
4850
if echo "$confirm" | grep -qE '^[Yy]$'; then
4951
return 0
5052
else

0 commit comments

Comments
 (0)