The -e argument to echo does not seemed to be supported by dash
and is treated as an literal.
# bash -c "echo -e fish"
fish
# dash -c "echo -e fish"
-e fish
The simple fix seems to be to just remove -e from invocations of echo.
the echo(1) man page documents the -e option as:
-e enable interpretation of backslash escapes
But none of the strings printed include such escape sequences.
This change removes the -e from the output if the init script
on systems where /bin/sh is dash:
# /etc/init.d/heartbeat start
Starting High-Availability services: mkdir: cannot create directory
`/var/run/heartbeat': File exists
...
-e Done.
Reported-by: Frederik Schüler <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Index: heartbeat/heartbeat/init.d/heartbeat.in
===================================================================
--- heartbeat.orig/heartbeat/init.d/heartbeat.in 2010-03-10
10:59:56.000000000 +1100
+++ heartbeat/heartbeat/init.d/heartbeat.in 2010-03-10 11:00:32.000000000
+1100
@@ -55,12 +55,12 @@ rund...@localstatedir@/run
echo_failure() {
- echo -e " Heartbeat failure [rc=$1]. $rc_failed"
+ echo " Heartbeat failure [rc=$1]. $rc_failed"
return $1
}
echo_success() {
- echo -e "$rc_done"
+ echo "$rc_done"
}
if
@@ -111,11 +111,11 @@ then
$HA_BIN/heartbeat -s
}
echo_failure() {
- echo -e " Heartbeat failure [rc=$1]. $rc_failed"
+ echo " Heartbeat failure [rc=$1]. $rc_failed"
return $1
}
echo_success() {
- echo -e "$rc_done"
+ echo "$rc_done"
}
else
. $DISTFUNCS
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/