Skip to content

Update 016-creating-an-interactive-menu-in-bash.md #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ebook/en/content/016-creating-an-interactive-menu-in-bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ At the beginning of your script add the following color functions:
##
green='\e[32m'
blue='\e[34m'
red='\e[31m'
clear='\e[0m'

##
Expand Down Expand Up @@ -127,8 +128,8 @@ $(ColorBlue 'Choose an option:') "
3) tcp_check ; menu ;;
4) kernel_check ; menu ;;
5) all_checks ; menu ;;
0) exit 0 ;;
*) echo -e $red"Wrong option."$clear; WrongCommand;;
0) exit 0 ;;
*) echo -e "${red}Wrong option.${clear}"; menu ;;
esac
}
```
Expand Down Expand Up @@ -165,7 +166,7 @@ Finally, we have a switch case which triggers a different function depending on
4) kernel_check ; menu ;;
5) all_checks ; menu ;;
0) exit 0 ;;
*) echo -e $red"Wrong option."$clear; WrongCommand;;
*) echo -e "${red}Wrong option.${clear}"; menu ;;
esac
```

Expand Down Expand Up @@ -236,6 +237,7 @@ function all_checks() {
##
green='\e[32m'
blue='\e[34m'
red='\e[31m'
clear='\e[0m'

##
Expand Down Expand Up @@ -267,7 +269,7 @@ $(ColorBlue 'Choose an option:') "
4) kernel_check ; menu ;;
5) all_checks ; menu ;;
0) exit 0 ;;
*) echo -e $red"Wrong option."$clear; WrongCommand;;
*) echo -e "${red}Wrong option.${clear}"; menu ;;
esac
}

Expand Down