autoconf
[Top][All Lists]
Advanced

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

_AS_ECHO_N_PREPARE questions


From: Stepan Kasal
Subject: _AS_ECHO_N_PREPARE questions
Date: Wed, 23 Feb 2005 14:18:02 +0100
User-agent: Mutt/1.4.1i

Hi,
  I read the macro _AS_ECHO_N_PREPARE:

m4_defun([_AS_ECHO_N_PREPARE],
[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
])

I have several questions:

1) why is ECHO_C set to newline in the first case?  In this case,
        echo $ECHO_N "foo$ECHO_C"
will add a newline, so I see no reason to add another one.

2) Why are we using '\c' on platforms which support both (if any)?
It would be more natural to use -n, which is more popular.

So I'd implement two changes, and the code would be:

ECHO_N= ECHO_C= ECHO_T=
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_T='     ' ;;    # Neither -n nor \c is supported.
  *,-n*)   ECHO_C='\c' ;;       # -n doesn't work, but \c does.
  *)       ECHO_N=-n ;;         # -n works.
esac

Paul, would you approve any of these suggestions (or both) for checking
in to the CVS?  (I'd cc autoconf-patches in that case, of course.)

Have a nice day,
        Stepan




reply via email to

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