[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] echo -n is not portable and used too much

From: Blair Zajac <blair_at_orcaware.com>
Date: 2002-02-11 07:40:08 CET

On Solaris, running make check results in output like this:

make check
-n Running all tests in path-test...
SUCCESS
-n Running all tests in random-test...
SUCCESS
-n Running all tests in hashdump-test...
SUCCESS
.
.
.

This patch fixes this.

I did a recursive grep for 'echo\s*-n' and found more in

./ac-helpers/gnu-diff.sh: echo -n "some text, no newline" > foofile
./ac-helpers/gnu-diff.sh: echo -n "...extra text, still no newline" >> foofile

These should also be fixed if the file is used.

We could use the echo test in configure for gnu-diff.sh, but for Makefile.in its
probably not worth it:

case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
  *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

echo $ECHO_N "checking for $ac_word... $ECHO_C"

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/

Index: ./Makefile.in
===================================================================
--- ./Makefile.in
+++ ./Makefile.in Sun Feb 10 22:32:55 2002
@@ -129,7 +129,7 @@
         list='$(TEST_PROGRAMS) @FS_TEST_PROGRAMS@'; for prog in $$list; do \
             progbase=`echo $$prog | sed 's?.*/??'` ; \
             progdir=`echo $$prog | sed 's?/[^/]*$$??'` ; \
- echo -n "Running all tests in $$progbase..." ; \
+ echo "Running all tests in $$progbase..." ; \
             echo "START: $$progbase" >> $$logfile ; \
             if echo $$progbase | grep \\.py$$ > /dev/null; then \
                 runprog="$(PYTHON) $(abs_srcdir)/$$prog" ; \
@@ -142,9 +142,9 @@
                 exit 1 ; \
             fi ; \
             if ( cd $$progdir && $$runprog ) >> $$logfile ; then \
- echo "SUCCESS" ; \
+ echo " SUCCESS" ; \
             else \
- echo "FAILURE" ; \
+ echo " FAILURE" ; \
                 failed=yes; \
             fi; \
             echo "END: $$progbase" >> $$logfile ; \

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.