summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-01-28 19:58:11 +0000
committerRichard Hughes <richard@hughsie.com>2008-01-28 19:58:11 +0000
commit103ac946fc745e048736b78bd50d0dcc5dcb5da7 (patch)
treefe5759aed43de33cbacda14a28a9c1e976899e2c
parent96560c7ef164c756669f22df2b9d198bf3731100 (diff)
Simplify parameter expansion in pm-action and pm-is-supported.
-rwxr-xr-xsrc/pm-action6
-rw-r--r--src/pm-is-supported2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/pm-action b/src/pm-action
index 7c2643b..c3e8cc4 100755
--- a/src/pm-action
+++ b/src/pm-action
@@ -27,7 +27,7 @@
# The rule here? Simplicity.
help_options() {
- echo "$(basename "$0") [options]"
+ echo "${0##*/} [options]"
echo
echo "Options can change how the supend or hibernate is done."
echo
@@ -89,9 +89,7 @@ done
[ -f /sys/power/state ] || exit 1
-ACTION=$(basename "$0")
-ACTION=${ACTION#pm-}
-ACTION=${ACTION/-/_}
+ACTION=${0##*pm-}
case "$ACTION" in
suspend)
diff --git a/src/pm-is-supported b/src/pm-is-supported
index 4f7e267..0bed480 100644
--- a/src/pm-is-supported
+++ b/src/pm-is-supported
@@ -23,7 +23,7 @@ help_options() {
export LC_COLLATE=C
-ARG=${1#--}
+ARG="${1#--}"
[ -f /sys/power/state ] || exit 1