fix(SC2162): add -r to read
This commit is contained in:
@@ -27,7 +27,7 @@ __contains_word () {
|
||||
__get_machines() {
|
||||
local a b
|
||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
||||
{ while read a b; do echo " $a"; done; } |
|
||||
{ while read -r a b; do echo " $a"; done; } |
|
||||
sort -u
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ __get_busnames() {
|
||||
local mode=$1
|
||||
local a b
|
||||
busctl $mode list --no-legend --no-pager --full 2>/dev/null |
|
||||
{ while read a b; do echo " $a"; done; }
|
||||
{ while read -r a b; do echo " $a"; done; }
|
||||
}
|
||||
|
||||
__get_objects() {
|
||||
@@ -43,7 +43,7 @@ __get_objects() {
|
||||
local busname=$2
|
||||
local a b
|
||||
busctl $mode tree --list --no-legend --no-pager $busname 2>/dev/null |
|
||||
{ while read a b; do echo " $a"; done; }
|
||||
{ while read -r a b; do echo " $a"; done; }
|
||||
}
|
||||
|
||||
__get_interfaces() {
|
||||
@@ -52,7 +52,7 @@ __get_interfaces() {
|
||||
local path=$3
|
||||
local a b c
|
||||
busctl $mode introspect --list --no-legend --no-pager $busname $path 2>/dev/null |
|
||||
{ while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }
|
||||
{ while read -r a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }
|
||||
}
|
||||
|
||||
__get_members() {
|
||||
@@ -65,7 +65,7 @@ __get_members() {
|
||||
local a b c d e
|
||||
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
||||
sed -e 's/^\.//' |
|
||||
{ while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }
|
||||
{ while read -r a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }
|
||||
}
|
||||
|
||||
__get_signature() {
|
||||
@@ -76,7 +76,7 @@ __get_signature() {
|
||||
local member=$5
|
||||
local a b c d
|
||||
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
||||
sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }
|
||||
sed -e 's/^\.//' | { while read -r a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }
|
||||
}
|
||||
|
||||
_busctl() {
|
||||
|
||||
Reference in New Issue
Block a user