fix(SC2162): add -r to read

This commit is contained in:
Eisuke Kawashima
2025-07-14 20:24:26 +09:00
parent cb2e0dc4f5
commit 01e769bc2e
20 changed files with 36 additions and 32 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ __bootctl() {
_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
+4 -4
View File
@@ -87,7 +87,7 @@ __dbus_matchspec() {
local -a bus_names
local NAME OTHER
__busctl --unique list |
while read NAME OTHER; do
while read -r NAME OTHER; do
echo $NAME
done
}
@@ -104,7 +104,7 @@ __dbus_matchspec() {
{
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
@@ -117,7 +117,7 @@ __dbus_matchspec() {
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#.}
@@ -128,7 +128,7 @@ __dbus_matchspec() {
{
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
+1 -1
View File
@@ -12,7 +12,7 @@ _kernel-install_images(){
(( $+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]* )
+1 -1
View File
@@ -4,7 +4,7 @@
(( $+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
}