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() {
|
||||
|
||||
@@ -27,7 +27,7 @@ __contains_word () {
|
||||
__get_machines() {
|
||||
local a b
|
||||
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
||||
{ while read a b; do echo " $a"; done; }
|
||||
{ while read -r a b; do echo " $a"; done; }
|
||||
}
|
||||
|
||||
__get_homes() {
|
||||
|
||||
@@ -29,7 +29,7 @@ __contains_word () {
|
||||
__get_machines() {
|
||||
local a b
|
||||
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
||||
{ while read a b; do echo " $a"; done; }
|
||||
{ while read -r a b; do echo " $a"; done; }
|
||||
}
|
||||
|
||||
_hostnamectl() {
|
||||
|
||||
@@ -26,8 +26,12 @@ __contains_word() {
|
||||
|
||||
__get_machines() {
|
||||
local a b
|
||||
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
||||
{ while read a b; do echo " $a"; done; } |
|
||||
{
|
||||
machinectl list-images --full --no-legend --no-pager 2>/dev/null
|
||||
machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null
|
||||
echo ".host"
|
||||
} |
|
||||
{ while read -r a b; do echo " $a"; done; } |
|
||||
sort -u
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,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
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ _kernel_install() {
|
||||
2)
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then
|
||||
read MACHINE_ID < /etc/machine-id
|
||||
read -r MACHINE_ID < /etc/machine-id
|
||||
if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then
|
||||
comps=$(cd "/boot/$MACHINE_ID"; echo [0-9]*)
|
||||
fi
|
||||
|
||||
@@ -33,7 +33,7 @@ __get_all_seats () { loginctl --no-legend list-seats | { while read -r a b
|
||||
__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
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ __contains_word() {
|
||||
__get_machines() {
|
||||
local a b
|
||||
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; 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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ __get_slice_units () { __systemctl list-units --all -t slice |
|
||||
__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
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ __get_all_unit_files() { __systemctl $1 list-unit-files "$2*" | while read -r a
|
||||
__get_machines() {
|
||||
local a
|
||||
|
||||
while read a _; do
|
||||
while read -r a _; do
|
||||
echo " $a"
|
||||
done < <(machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null | sort -u; echo ".host")
|
||||
}
|
||||
|
||||
@@ -29,7 +29,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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -26,24 +26,24 @@ __contains_word() {
|
||||
|
||||
__get_users() {
|
||||
local a b
|
||||
loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; }
|
||||
loginctl list-users --no-legend --no-pager | { while read -r a b; do echo " $b"; done; }
|
||||
}
|
||||
|
||||
__get_slices() {
|
||||
local a b
|
||||
systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; }
|
||||
systemctl list-units -t slice --no-legend --no-pager --plain | { while read -r a b; do echo " $a"; done; }
|
||||
}
|
||||
|
||||
__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
|
||||
}
|
||||
|
||||
__get_env() {
|
||||
local a
|
||||
env | { while read a; do echo " ${a%%=*}"; done; }
|
||||
env | { while read -r a; do echo " ${a%%=*}"; done; }
|
||||
}
|
||||
|
||||
__get_interfaces(){
|
||||
|
||||
@@ -29,7 +29,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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user