From 20f45928eaf72ed5413c0ac0c6e30bb771c03a5f Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Sun, 4 Mar 2012 12:22:18 +0100 Subject: Remove cat-subshells (cosmetic) The use of cat in a subshell is distractive. This makes the code more beautiful. --- scripts/netcfg-menu | 2 +- scripts/netcfg-wpa_actiond | 2 +- src/connections/ethernet | 8 ++++---- src/rfkill | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/netcfg-menu b/scripts/netcfg-menu index f7c9019..a62838a 100755 --- a/scripts/netcfg-menu +++ b/scripts/netcfg-menu @@ -53,7 +53,7 @@ case $ret in (( ret == 0 )) && echo "$DEFAULT" > "$STATE_DIR/menu" ;; 0) # User selection - profile_up "$(cat "$ANSWER")" + profile_up "$(< "$ANSWER")" ret=$? (( ret == 0 )) && mv "$ANSWER" "$STATE_DIR/menu" ;; diff --git a/scripts/netcfg-wpa_actiond b/scripts/netcfg-wpa_actiond index c8a2867..f276ab2 100755 --- a/scripts/netcfg-wpa_actiond +++ b/scripts/netcfg-wpa_actiond @@ -20,7 +20,7 @@ case $1 in [[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface" netcfg -i "$interface" stop_wpa "$interface" - kill $(cat "/run/wpa_actiond_${2}.pid") + kill $(< "/run/wpa_actiond_${2}.pid") # only try to disable software rfkill switches (FS#25514) if [[ "$RFKILL" == "soft" ]]; then set_rf_state "$interface" disabled $RFKILL_NAME || exit $? diff --git a/src/connections/ethernet b/src/connections/ethernet index 8665816..3e4a992 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -230,8 +230,8 @@ ethernet_down() { report_debug ethernet_down dhclient -q -r "$INTERFACE" dhclient -q -x "$INTERFACE" &>/dev/null #dhclient -q -r "$INTERFACE" &>/dev/null - report_debug ethernet_down /bin/kill $(cat /run/dhclient-$INTERFACE.pid) - /bin/kill $(cat /run/dhclient-$INTERFACE.pid) &>/dev/null + report_debug ethernet_down /bin/kill $(< /run/dhclient-$INTERFACE.pid) + /bin/kill $(< /run/dhclient-$INTERFACE.pid) &>/dev/null fi else if [[ -f "/run/dhcpcd-$INTERFACE.pid" ]]; then @@ -244,8 +244,8 @@ ethernet_down() { if [[ -f "/run/dhclient6-$INTERFACE.pid" ]]; then report_debug ethernet_down dhclient -6 -q -x "$INTERFACE" dhclient -6 -q -x "$INTERFACE" &>/dev/null - report_debug ethernet_down /bin/kill $(cat /run/dhclient6-$INTERFACE.pid) - /bin/kill $(cat /run/dhclient6-$INTERFACE.pid) &>/dev/null + report_debug ethernet_down /bin/kill $(< /run/dhclient6-$INTERFACE.pid) + /bin/kill $(< /run/dhclient6-$INTERFACE.pid) &>/dev/null fi fi diff --git a/src/rfkill b/src/rfkill index 4fbc34d..12e1832 100644 --- a/src/rfkill +++ b/src/rfkill @@ -21,7 +21,7 @@ get_rf_path() { if [[ -n "$RFKILL_NAME" ]]; then for path in /sys/class/rfkill/*; do - if [[ "$(cat "$path/name")" == "$RFKILL_NAME" ]]; then + if [[ "$(< "$path/name")" == "$RFKILL_NAME" ]]; then echo "$path" return 0 fi -- cgit v1.2.3-24-g4f1b