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.
bin
dir in/home/$USER
and add that to your path then put it inbin
now you can run it from anywherecd $(dirname $0)
as suggested in one the answers there?some/path/someProgram.exe someArg
is the entire script (although as I mentionedsomeProgram.exe
gets run by wine), and the specific executable/argument is irrelevant to the issue (plus I rather doubt you're familiar with it anyway).exe
file or maybe in some argument?