[X4U] Why does Bash do this?

Stroller macmonster at myrealbox.com
Mon Oct 10 15:10:56 PDT 2005


On Oct 10, 2005, at 10:06 pm, Robert Nicholson wrote:
>
> I'm confused about one feature of bash or /bin/sh under Tiger.
> ...
>
> sh build.sh
> + sh build.sh
> /System/Library/Frameworks/JavaVM.framework/Home
> : command not found
> : command not found
>
> those last two errors are because there's two blank lines at the end 
> of the script.
>
> Why does it complain about blank lines?

It doesn't here. Is it possible you could have edited the file in 
TextEdit or similar which has appended Macintosh carriage-returns or 
line-feeds or whatever to the lines? Try opening the build.sh in 
`pico`; of course they may not display in `pico` any more than they do 
with `cat` but please humour me by deleting the lines & adding them 
again.

Also, there's no need to call the script with sh, because you appear to 
have already specified that in the script's first line, "starting with 
a sha-bang". You just need to `chmod +x build.sh` and run it with 
`./build.sh` (without the quotes).

Stroller.



More information about the X4U mailing list