I've got a simple script which runs a windows program through wine with an argument (ie.
~/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:
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.
/home/$USERand add that to your path then put it in
binnow you can run it from anywhere
cd $(dirname $0)as suggested in one the answers there?
some/path/someProgram.exe someArgis the entire script (although as I mentioned
someProgram.exegets run by wine), and the specific executable/argument is irrelevant to the issue (plus I rather doubt you're familiar with it anyway).
exefile or maybe in some argument?