I'm trying to execute a mono application, without requiring the user to type in 'mono filename'. It's just one line of code:
mono ./Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9
It works great, so long as I call it from the correct directory. But if my current directory isn't exactly where the script is - it fails because the ./Bin is relative to the current directory. I want it to be relative to the location of the script.
I found that I was able to get the location of the script using
echo dirname "$(readlink -f "$0")"/Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9
That displays correctly on the screen; but I can't figure out how to put it into my first script such that mono executes that value.
I'm using 'tcsh', however I would prefer an answer agnostic to any shell.
I just want to run 'mono' + 'dirname "$(readlink -f "$0")"/Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9'
But I can't seem to get it right.