Im trying to create a startup script for the tuxnes emulator so far i have this
Quote:
#!/bin/bash
echo "Which game would you like to play"
read X
if [ -n "$X"];
then
tuxnes --renderer=auto --geometry=1024x768 --format=mu8 --sound=/dev/dsp --soundrate=44100 --js1=/dev/js0 $X;
else
echo "no such file found"
fi
|
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 ...