Add empty IFS for single var reads

This commit is contained in:
Lucas Gabriel Vuotto 2024-02-05 16:06:50 +00:00
parent 134c479e36
commit 49d068aad3
6 changed files with 7 additions and 7 deletions

View File

@ -46,7 +46,7 @@ if [ -t 0 ]; then
done
fi
else
while read -r flac; do
while IFS= read -r flac; do
[ -f "$flac" ] || err "$flac: not found"
convert_to_ogg "$flac" || rc=$?
done

View File

@ -23,7 +23,7 @@ renew_dhcp_if_needed() {
iface=$1
hostname_if=/etc/hostname."$iface"
[ ! -r "$hostname_if" ] && return
while read -r line; do
while IFS= read -r line; do
[ "$line" = dhcp ] && dhclient "$iface" && break
done <"$hostname_if"
}

View File

@ -38,7 +38,7 @@ scratch=$(mktemp -tp "$newdir" .sekrit-scratch-XXXXXXXXXX) ||
err "failed to create scratch file"
trap 'rm -fr -- "$scratch" "$newdir"' INT QUIT TERM
sekrit ls | while read -r entry; do
sekrit ls | while IFS= read -r entry; do
printf "%s... " "$entry"
sekrit get "$entry" >|"$scratch" ||
err "failed to export entry $entry"

View File

@ -38,7 +38,7 @@ FACESIZES="8.0 4.0 6.0 7.0 8.0 9.0 10.0 12.0"
basedpi=$(xdpyinfo | grep '^ resolution:' | {
min=
while read -r line; do
while IFS= read -r line; do
set -- $line
dpi_x=${2%%x*}
dpi_y=${2##*x}
@ -66,7 +66,7 @@ for facesize in $FACESIZES; do
done | bc -l | {
i=0
printf "Xft.dpi:\t%.1f\n" "$targetdpi"
while read -r v; do
while IFS= read -r v; do
if [ $i -eq 0 ]; then
printf "XTerm.VT100.faceSize:\t%f\n" "$v"
else

View File

@ -64,7 +64,7 @@ zonefile_regex=$(git config --default '\.zone$' hooks.zonefileregex)
needs_serial_bump=$(git diff-index --name-only --cached "$against" |
grep -E -- "$zonefile_regex" | {
rc=0
while read -r filename; do
while IFS= read -r filename; do
old=$(get_serial "$against:$filename")
new=$(get_serial ":$filename")
if bc_cmp "$new" "<=" "$old"; then

View File

@ -169,7 +169,7 @@ hc unlock
hc detect_monitors
hc list_monitors | while read -r line; do
hc list_monitors | while IFS= read -r line; do
m=${line%%:*}
sh ~/.config/herbstluftwm/herbstpanel.sh "$m" &
done