bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bash 3.1.5] sh -c "echo -n ok" broken


From: Chet Ramey
Subject: Re: [bash 3.1.5] sh -c "echo -n ok" broken
Date: Wed, 18 Jan 2006 20:25:40 -0500
User-agent: Thunderbird 1.5 (Macintosh/20051201)

Jeff Chua wrote:
> 
> GNU bash, version 3.1.5(1)-release
> 
> sh -c "echo -n ok" returns "-n ok".
> 
> This breaks a lot of scripts ... startup scripts in /etc/rc.d and many
> packages like glibc "make check" that use "sh" instead of "bash" with
> "-n" option.
> 
> How can I make sh -c "echo -n ok" returns "ok" instead "-n ok"?
> 
> I've tried compiling with --disable-strict-posix-default but that
> doesn't work.

It doesn't behave that way by default:

z3.local(1)$ ./sh --version
GNU bash, version 3.1.5(2)-release (powerpc-apple-darwin8.3.0)
Copyright (C) 2005 Free Software Foundation, Inc.
z3.local(1)$ ./sh -c 'echo -n ok'
okz3.local(1)$

Somehow you've enabled the xpg_echo option, either by configuring
with --enable-xpg-echo-default or running `shopt -s xpg_echo'
somewhere.  I suspect the former.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live Strong.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]