commit eba83b3aeabd6d07710b9925ce517971f9ce93fb
parent 5c5709d4bdb756647dd3bf2c60eeaa112cf344f8
Author: Cem Keylan <cem@ckyln.com>
Date: Mon, 3 Feb 2020 12:31:21 +0300
nap: shorten for loops
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/nap/nap b/nap/nap
@@ -4,10 +4,6 @@
[ "$1" ] && { printf 'Usage: %s\nThere are not many options when taking a nap.\n' "${0##*/}" ; exit 1 ;}
grep -q mem /sys/power/state || { printf "Suspend not supported.\n"; exit 1 ;}
test -w /sys/power/state || { printf "Sleep permission denied.\n" ; exit 1 ;}
-for hook in /etc/zzz.d/suspend/* ; do
- [ -x "$hook" ] && "$hook"
-done
+for hook in /etc/zzz.d/suspend/* ; do [ -x "$hook" ] && "$hook" ; done
printf mem >/sys/power/state || { printf "Could not suspend.\n" ; exit 1 ;}
-for hook in /etc/zzz.d/resume/*; do
- [ -x "$hook" ] && "$hook"
-done
+for hook in /etc/zzz.d/resume/*; do [ -x "$hook" ] && "$hook" ; done