Reputation: 131
I am on mac and I have a .command
file which on double click should run my script and hence the application opens.
But the issue is that the application runs from the root folder and not the current folder. How can I automate the way, that the application first automatically enters my current directory
and then proceed.
Probably some cd
statement at top of the script
Upvotes: 5
Views: 2320
Reputation: 31754
Do cd "$(dirname "$0")"
to enter the current directory. And have your respective code after it.
Upvotes: 6