Bug 10270 - gccbug's echo displays '-n' instead of no-line-break
Summary: gccbug's echo displays '-n' instead of no-line-break
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 3.2.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-30 12:16 UTC by Hallvard B Furuseth
Modified: 2011-03-23 00:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-26 19:11:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hallvard B Furuseth 2003-03-30 12:16:00 UTC
	gccbug asks '-n a)bort, e)dit or s)end?' when /bin/echo
	is the first echo in $PATH.

Release:
3.2.2

Environment:
System: SunOS bombur.uio.no 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

	
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.2.2/configure --enable-languages=c,c++,f77 --prefix=/usit/bombur/hbf --enable-version-specific-runtime-libs --enable-threads

How-To-Repeat:
	PATH="/bin:$PATH" gccbug
Comment 1 Hallvard B Furuseth 2003-03-30 12:16:00 UTC
Fix:
Don't hard-code ECHON=bsd in gccbug, instead check for bsd vs. sysv echo
at run-time:

--- gccbug~	Sun Mar 30 01:15:28 2003
+++ gccbug	Sun Mar 30 13:55:33 2003
@@ -56,16 +56,13 @@
 PASSWD="cat /etc/passwd"
 
-ECHON=bsd
-
-if [ $ECHON = bsd ] ; then
-  ECHON1="echo -n"
-  ECHON2=
-elif [ $ECHON = sysv ] ; then
-  ECHON1=echo
-  ECHON2='\c'
-else
-  ECHON1=echo
-  ECHON2=
-fi
+ECHON1="echo -n"
+ECHON2='\c'
+case `$ECHON1 "foo $ECHON2"` in
+  -n*c)	ECHON1=echo
+	ECHON2=
+	;;
+  -n*)	ECHON1=echo ;;
+  *)	ECHON2= ;;
+esac
 
 #
Comment 2 Dara Hazeghi 2003-05-26 22:52:28 UTC
Hello,

I can confirm that this problem is still present in gccbug on gcc 3.3 branch and mainline. Could 
you send the patch you included to the gcc-patches list? Thanks,

Dara
Comment 3 Andrew Pinski 2003-05-27 13:04:16 UTC
Make sure you sent your patch to gcc-patches@gcc.gnu.org.
Comment 4 Hallvard B Furuseth 2003-05-27 13:32:20 UTC
Subject: Re:  gccbug's echo displays '-n' instead of no-line-break

pinskia@physics.uc.edu writes:

> Make sure you sent your patch to gcc-patches@gcc.gnu.org.

Sent.

Comment 5 Andrew Pinski 2003-10-30 07:14:01 UTC
patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-05/msg02245.html>.
Comment 6 Andrew Pinski 2004-10-18 04:03:50 UTC
Hmm, this file really comes from GNU GNATS, maybe we should update it from there and you should 
submit the patch to there if it is not already changed.
Comment 7 Andrew Pinski 2004-10-18 04:05:34 UTC
Just to tell you the GNATs 4.0 regression does not have this patch in it.
Comment 8 Daniel Berlin 2004-10-18 04:08:48 UTC
Subject: Re:  gccbug's echo displays '-n' instead of
	no-line-break

On Mon, 2004-10-18 at 04:03 +0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-18 04:03 -------
> Hmm, this file really comes from GNU GNATS, maybe we should update it from there and you should 
> submit the patch to there if it is not already changed.
> 

Or maybe we should kill gccbug finally?
:)
Please?


--

 

Comment 9 Joseph S. Myers 2011-03-23 00:31:32 UTC
gccbug was removed from GCC.
Comment 10 Joseph S. Myers 2011-03-23 00:31:49 UTC
gccbug was removed from GCC.