- Forums
- Bash Scripts
- Bash: For To Enter Required Input And Not Leave Blank
This Page Contains information about Bash: For To Enter Required Input And Not Leave Blank By edwin in category Bash Scripts with 0 Replies. [5036], Last Updated: Mon Jun 24, 2024
edwin
Wed Dec 21, 2022
0 Comments
345 Visits
This simple loop will ensure that in a bash script the prompt will ask the user to enter something, if not or they leave empty, will required to enter text before it can go to the next line in the code:
while [[ $APP_ROUTE == "" ]]
do
read -p "Enter the Route: " APP_ROUTE
set -e
done