[SOLVED]Basic If statments problem
Hi, im trying to create my first script for an Administrator to install users in debain(Ive noticed differences between debian and Opensuse in scripting/commands)and I'm haing having problems with the if statment. so far this is what I have written:
Code:
echo "Would you like to create a new user?(yes/no)" but when i run the script I recieve this out put: Code:
Would you like to create a new user?(yes/no) so basically im a little lost on what to do at the moment and help would be much apprecieated. also if there are any good online guides could somewone point them out please. Thanks for reading. |
Try running the "yes" command in the terminal... That's why it doesn't terminate. You wanted:
Code:
continue="yes" Code:
if [ "$input" == "$continue" ] Hope this helps, |
Problem is with password line as you cannot supply password in advance in script itself, plus there's little syntax error. I tried to correct it, so once try it:
PHP Code:
PHP Code:
|
Quote:
and thanks shiva for pointing out those errors. |
All times are GMT -5. The time now is 12:47 AM. |