Im trying to create a startup script for the tuxnes emulator so far i have this
echo "Which game would you like to play"
if [ -n "$X"];
tuxnes --renderer=auto --geometry=1024x768 --format=mu8 --sound=/dev/dsp --soundrate=44100 --js1=/dev/js0 $X;
echo "no such file found"
when i run ./tuxnes.sh
i get the prompt that ask for "which game you would like to play"
I then enter Metroid.nes and soon after I pres enter i recieve this error
./tuxnes.sh: line 9: [: missing `]'
no such file found
Im very new to writing scripts. Can someone tell me what is wrong with this one. Line 9 seems ok to me.????????
*****UPDATE I finally figured it out ***************
There is no space between "X" and ] in [ -n "X"] thats why it couldnt work ...