about summary refs log tree commit diff
path: root/zzz
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-04-02 11:00:50 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2015-04-02 11:00:50 +0200
commit806542bb01cf5c1ab7534ab532a1e1f0f3450b42 (patch)
tree26f0a5c599b939bc0286270843c8a2c00f0d1795 /zzz
parent12c657aa09efeed53e54ecb8f3fbd40c46d32746 (diff)
downloadrunit-void-806542bb01cf5c1ab7534ab532a1e1f0f3450b42.tar.gz
runit-void-806542bb01cf5c1ab7534ab532a1e1f0f3450b42.tar.xz
runit-void-806542bb01cf5c1ab7534ab532a1e1f0f3450b42.zip
zzz: Use printf(1) instead of echo(1) -n
The behaviour of the -n flag is implementation-defined

See:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html#tag_20_37
Diffstat (limited to 'zzz')
-rwxr-xr-xzzz8
1 files changed, 4 insertions, 4 deletions
diff --git a/zzz b/zzz
index ead0051..69fd3b1 100755
--- a/zzz
+++ b/zzz
@@ -39,18 +39,18 @@ test -w /sys/power/state || fail "sleep permission denied"
 (
 flock -n 9 || fail "another instance of zzz is running"
 
-echo -n "Zzzz... "
+printf "Zzzz... "
 
 for hook in /etc/zzz.d/suspend/*; do
   [ -x "$hook" ] && "$hook"
 done
 
 case "$ZZZ_MODE" in
-  standby) echo -n freeze >/sys/power/state || fail "standby failed";;
-  suspend) echo -n mem >/sys/power/state || fail "suspend failed";;
+  standby) printf freeze >/sys/power/state || fail "standby failed";;
+  suspend) printf >/sys/power/state || fail "suspend failed";;
   hibernate)
 	echo $ZZZ_HIBERNATE_MODE >/sys/power/disk
-	echo -n disk >/sys/power/state || fail "hibernate failed";;
+	printf disk >/sys/power/state || fail "hibernate failed";;
   noop) sleep 5;;
 esac