What does the placeholder contain? Are you invoking the script from the same shell where the direct call works? In particular, were the proxy settings the same?
–
GillesJul 13 '11 at 0:12

1

What is "Doesn't work"? What exactly is the output when it "Doesn't work"? How are you invoking it? Is this from a cron job? Are you passing it to a shell e.g. bash foo.sh? Are you executing by path e.g. ./foo.sh?
–
SorpigalJul 13 '11 at 11:45

3 Answers
3

You know that you need to add an x (execute) flag on Unix to execute a shell script? Another common pitfall for DOS users is that for security reasons there is often no "." in the PATH Environment thus you need to run "./your-script" instead of just "your-script".

Concerning the she-bang mentioned in the other answer. At least on Linux /bin/sh is the default shell used if no she-bang is given inside the script. It is still good practice to always add one to all scripts.

That depends on where bash is located. On my box, it's /usr/local/bin/bash ;)
–
AlexWebrJul 13 '11 at 12:02

Try #!/usr/bin/env bash - most systems place env in /usr/bin, so it's pretty portable. The down side is that it's easy to intercept by adding a custom bash interpreter earlier in your PATH.
–
SorpigalJul 13 '11 at 14:38