UNIX shell scripting - if else condition -
i making trivia game in unix voiceover utility on mac os x. shell script below. why won't if-else condition work? ideas?
#!/bin/sh clear echo "hey gamers! playing marvel comics" echo "what super hero name?" -v victoria "what super hero name?" read name echo "$name, sounds pretty epic hero." -v victoria "$name, sounds pretty epic hero." echo "see if know names of other epic heroes marvel comics." -v victoria "see if know names of other epic heroes marvel comics." echo "#1. world war 2 veteran, steve rogers, known super hero name?" -v victoria "world war 2 veteran, steve rogers, known super hero name?" read answer1 if [$answer1 = "captain america"] echo "correct. - steve rogers captain america." -v victoria "correct. steve rogers captain america."; else echo "incorrect. - steve rogers captain america" -v victoria "incorrect. steve rogers captain america" fi
thanks higuaro & william pursell help!
here's unix shell - trivia game mac os x!
#!/bin/sh clear echo "hey gamers! playing marvel comics" echo "what super hero name?" -v victoria "what super hero name?" read name echo "$name, sounds pretty epic hero." -v victoria "$name, sounds pretty epic hero." echo "see if know names of other epic heroes marvel comics." -v victoria "see if know names of other epic heroes marvel comics." echo "#1. world war 2 veteran, steve rogers, known captain (what)?" -v victoria "world war 2 veteran, steve rogers, known captain what?" read answer1 if [ $answer1 = "america" ] echo "correct. - steve rogers captain america." -v victoria "correct. steve rogers captain america."; else echo "incorrect. - steve rogers captain america" -v victoria "incorrect. steve rogers captain america" fi
Comments
Post a Comment