in reply to running scripts in Mac OS 10.4
What happens when you try to run it the way you want to run it?
Sometimes I've seen scripts fail because the shebang line has a trailing carriage return. You can find this if you run it through "od" or some other hex dump program.
$ head -1 good.pl | od -c 0000000 # ! / u s r / b i n / p e r l \n 0000020 $ head -1 bad.pl | od -c 0000000 # ! / u s r / b i n / p e r l \r 0000020 \n 0000021
You can strip out the carriage returns using perl this way:
perl -pi.bak -e 's/\r//g' my_script.pl
If the script is supposed to have some carriage return in it, this will break it, but that's unusual. If it causes a problem, the above line creates a .bak file that you can revert to.
|
|---|