Click here to Skip to main content
15,900,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all visitors
i have problem with add new user to fedora core.5
i want to create one shell script that can let user to input new user account to fedora.it is ok for adding new user to fedora but i want to consider that
when the user doesn't input any text, it will let user input user name again.
i mean it is like goto label in C or C++,when the user doesn't input any text, it will let user input again.
for shell script how can i create goto label like C or C++?
Thanks
Posted

1 solution

It's a while since I wrote shell scripts but maybe something like:
JavaScript
name=$1
while "$name"==""
do
  echo "Please enter your name"
  read name
done
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900