From cef4de2af04e7ffa6729ec029f7db2dd1179169c Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Sat, 27 Jun 2020 20:19:47 -0500 Subject: [PATCH] Use "$@" for expansion calls rather than manually listing argument numbers --- scripts/appscripts/sxmo_record.sh | 2 +- scripts/core/sxmo_brightness.sh | 2 +- scripts/core/sxmo_gpsutil.sh | 4 ++-- scripts/core/sxmo_lisgdonefingercheck.sh | 2 +- scripts/core/sxmo_lisgdstart.sh | 2 +- scripts/core/sxmo_timezonechange.sh | 2 +- scripts/modem/sxmo_modemcall.sh | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/appscripts/sxmo_record.sh b/scripts/appscripts/sxmo_record.sh index 031d313..4093019 100755 --- a/scripts/appscripts/sxmo_record.sh +++ b/scripts/appscripts/sxmo_record.sh @@ -98,5 +98,5 @@ recordmenu() { if [ -z "$1" ]; then recordmenu else - "$1" "$2" "$3" + "$@" fi diff --git a/scripts/core/sxmo_brightness.sh b/scripts/core/sxmo_brightness.sh index 739bc3e..0255bbb 100755 --- a/scripts/core/sxmo_brightness.sh +++ b/scripts/core/sxmo_brightness.sh @@ -26,4 +26,4 @@ down() { setdelta "-${STEP}" } -"$1" "$2" \ No newline at end of file +"$@" diff --git a/scripts/core/sxmo_gpsutil.sh b/scripts/core/sxmo_gpsutil.sh index 019e37f..9c19a5a 100755 --- a/scripts/core/sxmo_gpsutil.sh +++ b/scripts/core/sxmo_gpsutil.sh @@ -84,7 +84,7 @@ gpslatlonget() { echo "$LAT" "$LON" "$ZOOM" } gpslatlonset() { - CORDS="$(echo $@ | tr -d ',°')" + CORDS="$(echo "$@" | tr -d ',°')" LAT="$(echo "$CORDS" | cut -d' ' -f1)" LON="$(echo "$CORDS" | cut -d' ' -f2)" ZOOM="$(echo "$CORDS" | cut -d' ' -f3)" @@ -226,4 +226,4 @@ menumaptype() { done } -"$1" "$2" "$3" "$4" "$5" \ No newline at end of file +"$@" diff --git a/scripts/core/sxmo_lisgdonefingercheck.sh b/scripts/core/sxmo_lisgdonefingercheck.sh index bd63e22..d970aa3 100755 --- a/scripts/core/sxmo_lisgdonefingercheck.sh +++ b/scripts/core/sxmo_lisgdonefingercheck.sh @@ -4,5 +4,5 @@ WMCLASS="$(xprop -id "$ACTIVEWIN" | grep WM_CLASS | cut -d ' ' -f3-)" # E.g. just a check to ignore 1-finger gestures in foxtrotgps if echo "$WMCLASS" | grep -vi foxtrot; then - $@ + "$@" fi diff --git a/scripts/core/sxmo_lisgdstart.sh b/scripts/core/sxmo_lisgdstart.sh index 05dccc6..69737c4 100755 --- a/scripts/core/sxmo_lisgdstart.sh +++ b/scripts/core/sxmo_lisgdstart.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh pkill -9 lisgd -lisgd $@ \ +lisgd "$@" \ -g '1,LR,sxmo_lisgdonefingercheck.sh xdotool key --clearmodifiers Alt+Shift+e' \ -g '1,RL,sxmo_lisgdonefingercheck.sh xdotool key --clearmodifiers Alt+Shift+r' \ -g '1,DLUR,sxmo_lisgdonefingercheck.sh sxmo_vol.sh up' \ diff --git a/scripts/core/sxmo_timezonechange.sh b/scripts/core/sxmo_timezonechange.sh index 736a640..22eb028 100755 --- a/scripts/core/sxmo_timezonechange.sh +++ b/scripts/core/sxmo_timezonechange.sh @@ -19,7 +19,7 @@ menu() { } if [ $# -gt 0 ]; then - "$1" "$2" + "$@" else menu fi diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 120b02c..bc5eec0 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -217,4 +217,4 @@ pickup() { } modem_n || fatalerr "Couldn't determine modem number - is modem online?" -"$1" "$2" \ No newline at end of file +"$@" \ No newline at end of file