[Wine] Script Help

Martin Gregorie martin at gregorie.org
Sun May 31 13:30:26 CDT 2009


On Sun, 2009-05-31 at 12:47 -0500, mooseranger wrote:
> I tried making the script just sleep longer; that didn't help.  The
> script is called LOTRBFME2.sh and I ran it with 'sh LOTRBFME2.sh' - is
> there a different way I should run the script that would make it as if
> I manually ran it? (I'm new to this).
> 
Does the script just run xrandr or does it run xrandr, wait 5 seconds
and then start LOTR? If it does the first things may be confused by you
using several shells:

- first is the shell that put up your command prompt
- using "sh LOTRBFME2.sh" starts a new shell to run your script
- if your script starts with "#!/bin/sh" that will start a third shell
- the third shell will run the script and exit, then the second shell
  will exit to leave you in the original shell, but any shell variables
  the 2nd and 3rd shells set up will be lost

The second shell is always redundant: all scripts should start with
"#!/bin/shell" to make sure the right 'shell' is run. This way you never
need to write "sh script" to run a script from the command line. So, fix
that and then try one of the following:

- run a script (WITHOUT the #! line) as ". script" to run it in your
  original shell and follow it with "wine blahblah" to run LOTR

- write and run a script looks something like:

   #!/bin/bash
   xrandr [optionds and arguments]  #run xrandr
   sleep 5			    #wait 5 secs
   wine blahblah		    #start LOTR
   exit

  not forgetting to make it executable "chmod u+x scriptname"
  before running it.

Martin





More information about the wine-users mailing list