Author: rmeggins
Update of /cvs/dirsec/ldapserver/wrappers
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1859/ldapserver/wrappers
Modified Files:
initscript.in
Log Message:
Reviewed by: nhosoi (Thanks!)
Fix Description: We cannot figure out at build time whether to use echo -n or echo \c
because the user may use a different shell at run time e.g. using bash to run configure
but using /sbin/sh at run time. So, we just figure out at runtime what kind of echo is
being used and deal with it.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: initscript.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/wrappers/initscript.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- initscript.in 5 Oct 2007 23:45:50 -0000 1.7
+++ initscript.in 8 Dec 2007 17:40:32 -0000 1.8
@@ -26,10 +26,17 @@
exit 0
fi
-# Solaris echo cannot use -n - linux echo by default cannot use \c
+# figure out which echo we're using
+ECHO_N=`echo -n`
+
+# some shells echo cannot use -n - linux echo by default cannot use \c
echo_n()
{
- echo @ECHO_N@ "$*@ECHO_C@"
+ if [ "$ECHO_N" = '-n' ] ; then
+ echo "$*\c"
+ else
+ echo -n "$*"
+ fi
}
# failure and success are not defined on some platforms
Show replies by date