It wouldn't say "can't cd to /whatever/directory" then. FRuMMaGe: Can you run "od -c yourscript.sh", and check that there are indeed only \n characters for line ending, and no \r? The "can't cd to /whatever/directory" error is printed if you do have this wrong, which is why I wouldn't rule out this possibility without seriously checking.