Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose my_folder contains my_script and my_program. my_script tries to run ./my_program -myoptions. It works when I cd into the directory, but not when I double click on it.

Here is the output:

CasebashMac:~ chris$ /Users/chris/Programs/synergy-1.3.1\ 2/work_comp_server ; exit;
/Users/chris/Programs/synergy-1.3.1 2/work_comp_server: line 1: ./synergys: No such file or directory

How can I fix this?

share|improve this question
up vote 2 down vote accepted

"./synergys" is a path relative to the directory which you are currently in. To fix this you will need to specify an absolute path, for example:


Obviously change it to a path that actually exists :)

Might be overkill, but there is a wikipedia page about paths:


share|improve this answer
Why isn't the script run in the path it resides when I double click? Is there a way to refer to paths relative to the script? – Casebash Sep 17 '10 at 4:22
Assuming you are using a bash script, this question over at stackoverflow will help you out :)… – Nippysaurus Sep 17 '10 at 23:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.