Re: cross-compiling on OS X, make menuconfig fails

From: Timur Tabi
Date: Tue Apr 29 2008 - 10:59:49 EST


Roland Kuhn wrote:

> For some strange reason Apple decided to change 'echo':
>
> /bin/bash -c 'echo -e ...' does the right thing
> /bin/sh -c 'echo -e ...' keeps the "-e" in the output but interprets
> the \n
> /bin/echo -e ... does no interpretation and even keeps the \n

Wow, that is messed up. Especially since "/bin/sh --version" and "/bin/bash
--version" give me the same output.

Would you say that OS X is broken? I'm having a hard time finding documentation
for 'sh', so I can't find out what echo -e is supposed to do in 'sh'.

I read in the latest Linux Journal magazine that someone noticed that even
though the kernel scripts say #!/bin/sh, many of them are really bash scripts.
This person went through the effort of changing the script to be true 'sh'
scripts. Has that code been merged in?

> I'd recommend installing the coreutils-default package from fink, then
> you get a sane /sw/bin/echo.

But the scripts still reference /bin/sh, so I would need to change the scripts
or symlink /bin/sh. If I'm going to symlink /bin/sh, I'd rather just symlink it
to /bin/bash.

> Side-note on sanity: ISTR that POSIX defines echo in this (/bin/echo)
> strange way, urging people to use printf instead.

But printf is bash, not sh. I would need to change #!/bin/sh to #!/bin/bash.

--
Timur Tabi
Linux kernel developer at Freescale
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/