This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Bug other/10270] gccbug's echo displays '-n' instead of no-line-break
- From: Hallvard B Furuseth <h dot b dot furuseth at usit dot uio dot no>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 May 2003 15:30:20 +0200
- Subject: [Bug other/10270] gccbug's echo displays '-n' instead of no-line-break
Here is a patch from
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10270
Don't hard-code ECHON=bsd in gccbug, instead check for bsd vs. sysv echo
at run-time:
--- gcc-3.3/gcc/gccbug.in~ Thu Jan 2 06:22:37 2003
+++ gcc-3.3/gcc/gccbug.in Tue May 27 15:24:31 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
#
--
Hallvard