[X4U] Why does Bash do this?

Robert Nicholson robert at elastica.com
Mon Oct 10 15:59:55 PDT 2005


Yeah after I look at the file with od -a I could see that there were  
dos like newlines/carriage returns in it.

On Oct 10, 2005, at 5:10 PM, Stroller wrote:

>
> 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.
>
> _______________________________________________
> X4U mailing list
> X4U at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x4u
>
> Listmom is trying to clean out his closets! Vintage Mac and random  
> stuff:
>         http://search.ebay.com/_W0QQsassZmacguy1984
>


More information about the X4U mailing list