Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    Linux 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?

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    2
    Cool, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...