From 71c2c16655cbd7ee3d23bd0a3a9badae319e5e0d Mon Sep 17 00:00:00 2001 From: Pk-web6936 <202365630+Pk-web6936@users.noreply.github.com> Date: Fri, 16 May 2025 20:47:24 +0330 Subject: [PATCH] Code refactoring read without -r will mangle backslashes https://github.com/koalaman/shellcheck/wiki/SC2162 --- x-ui.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-ui.sh b/x-ui.sh index a7cee914..1543f5f8 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -69,7 +69,7 @@ confirm_restart() { } before_show_menu() { - echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read temp + echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read -rp temp show_menu } @@ -126,7 +126,7 @@ update_menu() { legacy_version() { echo "Enter the panel version (like 2.4.0):" - read tag_version + read -rp tag_version if [ -z "$tag_version" ]; then echo "Panel version cannot be empty. Exiting." @@ -256,7 +256,7 @@ check_config() { } set_port() { - echo && echo -n -e "Enter port number[1-65535]: " && read port + echo && echo -n -e "Enter port number[1-65535]: " && read -rp port if [[ -z "${port}" ]]; then LOGD "Cancelled" before_show_menu