summaryrefslogtreecommitdiffstats
path: root/wrappers
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2007-12-08 17:40:32 +0000
committerRich Megginson <rmeggins@redhat.com>2007-12-08 17:40:32 +0000
commit42a52a6e33873a3979de74bdbe2c056905af3d7c (patch)
tree52273adccb1c51382aa6a16ca11cd7cb386d6db1 /wrappers
parenta09c2cb8bf50719740d3c0bdaeed6bd813abfd50 (diff)
downloadds-42a52a6e33873a3979de74bdbe2c056905af3d7c.tar.gz
ds-42a52a6e33873a3979de74bdbe2c056905af3d7c.tar.xz
ds-42a52a6e33873a3979de74bdbe2c056905af3d7c.zip
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
Diffstat (limited to 'wrappers')
-rw-r--r--wrappers/initscript.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/wrappers/initscript.in b/wrappers/initscript.in
index 320d3506..a4a8e48e 100644
--- a/wrappers/initscript.in
+++ b/wrappers/initscript.in
@@ -26,10 +26,17 @@ then
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