__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
}
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() {
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() {
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() {
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() {
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() {
__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() {
__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() {
__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
}
__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
}
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
__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_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
}
__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_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_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")
}
__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_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_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_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(){
__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
}
_bootctl_comp_ids() {
local expl
local -a ids
- __bootctl list | while read a b; do
+ __bootctl list | while read -r a b; do
if [[ "$a" == "id:" ]]; then
ids+="$b"
fi
local -a bus_names
local NAME OTHER
__busctl --unique list |
- while read NAME OTHER; do
+ while read -r NAME OTHER; do
echo $NAME
done
}
{
local NAME TYPE OTHER
__busctl introspect "$1" "$2" |
- while read NAME TYPE OTHER; do
+ while read -r NAME TYPE OTHER; do
if [[ ${TYPE} == "interface" ]]; then
echo ${NAME}
fi
local required="$5"
local NAME TYPE SIGNATURE VALUE FLAGS
__busctl introspect "$1" "$2" "$3" |
- while read NAME TYPE SIGNATURE VALUE FLAGS; do
+ while read -r NAME TYPE SIGNATURE VALUE FLAGS; do
[[ -z "$member" || ${TYPE} == "$member" ]] &&
[[ -z "$required" || "${${(os: :)FLAGS}}" == $~required ]] &&
echo ${NAME#.}
{
local NAME TYPE SIGNATURE VALUE FLAGS
__busctl introspect "$1" "$2" "$3" |
- while read NAME TYPE SIGNATURE VALUE FLAGS; do
+ while read -r NAME TYPE SIGNATURE VALUE FLAGS; do
if [[ ${NAME#.} == "$4" ]]; then
[[ ${SIGNATURE} != "-" ]] && echo ${SIGNATURE}
fi
(( $+functions[_kernel-install_kernels] )) ||
_kernel-install_kernels(){
- read _MACHINE_ID < /etc/machine-id
+ read -r _MACHINE_ID < /etc/machine-id
_kernel=( /lib/modules/[0-9]* )
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
_kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
(( $+functions[__sd_machines_get_machines] )) ||
__sd_machines_get_machines () {
{ 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
}