Results 1 to 3 of 3
this is my script to find out if a filename contains wither the word "drive_c", or "DosBox", and hopefully run the commands to run the app.
I run it like ...
- 10-16-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
script question
this is my script to find out if a filename contains wither the word "drive_c", or "DosBox", and hopefully run the commands to run the app.
I run it like this
./rungame ~/DosBox/games/Raptor/RAP.EXE
or
./rungame .wine/drive_c/windows/notepad.exe
But each time I run it, it comes up with the phrase, "File should be run as DosBox app"
My 1st attempt is this:
#
# if path contains wine
# run program with command
# env WINEPREFIX="/home/ken/.wine" wine $1
#
# if path contains dosbox
# run program with command
# dosbox $1 -fullscreen
#
grep -in "drive_c" $1
if [ $? -eq "0" ]
then
echo "File should be run as Wine App"
else
echo "File should be run as DosBox app"
fi
read -p "Press any key to start backup…"
Any help would be greatly appreciated. Im a NOOB in scripting using any command line programs, so I'm sure I probably shouldnt even use grep for this.
Thanks
- 10-17-2009 #2Linux Newbie
- Join Date
- Sep 2004
- Location
- UK
- Posts
- 160
change grep -in "drive_c" $1 to echo $1 | grep -in "drive_c"
In a world without walls and fences, who needs Windows and Gates?
- 10-17-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
Cool, thanks


Reply With Quote