d3vi1dog562
August 1st, 2010, 12:12 AM
Im writing a script to help automate some tasks and i can get a the user input 1 2 or 3 to execute different things. I can't figure out how to get the read value to work in the if then statement. Please help here is a layout of the problem.
#!/bin/bash
echo """ Input your selection
1) KillAll, enable script!
2) Ooops error.
3) Doh.
"""
read mine
if mine=1
then
echo " Your select will begin shortly:"
elif mine=2
echo "Bad choice since the program isn't finished"
else
echo "DOOOOOOOH"
fi
sleep 15
exit
please help me with my problem
#!/bin/bash
echo """ Input your selection
1) KillAll, enable script!
2) Ooops error.
3) Doh.
"""
read mine
if mine=1
then
echo " Your select will begin shortly:"
elif mine=2
echo "Bad choice since the program isn't finished"
else
echo "DOOOOOOOH"
fi
sleep 15
exit
please help me with my problem