1

I've got a simple script which runs a windows program through wine with an argument (ie. myScript.sh = ~/some/path/someProgram.exe someArg). When I run it from its own directory it works fine:

cd ~/some/path
./myScript.sh

However if I try to run it from somewhere else:

cd /home/me
./some/path/myScript.sh

Because of How to execute script in different directory? I thought this might work:

/home/me/some/path/myScript.sh

but the script (or the resulting wine call) fails if I do anything other than run the script from the directory. Is there anyway to call the script from elsewhere without breaking it?

P.S. This isn't a permissions issue: the script has executable permission on for all users.

1 Answers1

2

I found a sloppy solution: I made things working by explicitly calling cd inside my script and then using wine explicitly to run the executable:

cd ~/some/path
wine someProgram.exe someArg

However it seems like there should be some way to make that work without explicitly calling cd, and I'll accept any answer that explains it. I won't accept this one since it doesn't truly answer my original question (because it does the cd it's not really running things "from elsewhere").