Skip to content

Commit f1f104b

Browse files
Update 016-creating-an-interactive-menu-in-bash.md (#176)
I updated this line *) echo -e "${red}Wrong option.${clear}"; menu ;; and red variable was not defined
1 parent 3c80f7e commit f1f104b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ebook/en/content/016-creating-an-interactive-menu-in-bash.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ At the beginning of your script add the following color functions:
8383
##
8484
green='\e[32m'
8585
blue='\e[34m'
86+
red='\e[31m'
8687
clear='\e[0m'
8788

8889
##
@@ -127,8 +128,8 @@ $(ColorBlue 'Choose an option:') "
127128
3) tcp_check ; menu ;;
128129
4) kernel_check ; menu ;;
129130
5) all_checks ; menu ;;
130-
0) exit 0 ;;
131-
*) echo -e $red"Wrong option."$clear; WrongCommand;;
131+
0) exit 0 ;;
132+
*) echo -e "${red}Wrong option.${clear}"; menu ;;
132133
esac
133134
}
134135
```
@@ -165,7 +166,7 @@ Finally, we have a switch case which triggers a different function depending on
165166
4) kernel_check ; menu ;;
166167
5) all_checks ; menu ;;
167168
0) exit 0 ;;
168-
*) echo -e $red"Wrong option."$clear; WrongCommand;;
169+
*) echo -e "${red}Wrong option.${clear}"; menu ;;
169170
esac
170171
```
171172

@@ -236,6 +237,7 @@ function all_checks() {
236237
##
237238
green='\e[32m'
238239
blue='\e[34m'
240+
red='\e[31m'
239241
clear='\e[0m'
240242

241243
##
@@ -267,7 +269,7 @@ $(ColorBlue 'Choose an option:') "
267269
4) kernel_check ; menu ;;
268270
5) all_checks ; menu ;;
269271
0) exit 0 ;;
270-
*) echo -e $red"Wrong option."$clear; WrongCommand;;
272+
*) echo -e "${red}Wrong option.${clear}"; menu ;;
271273
esac
272274
}
273275

0 commit comments

Comments
 (0)