toys fixes
checkmissing: add missing read -d \0 cleandestinations: use NULL separator in find, use SQL placedholmder
This commit is contained in:
parent
3e01f47ea8
commit
f56bf00916
@ -87,7 +87,7 @@ do
|
||||
destination_names[id]=${rest%%::AtOM:SQL:Sep::*}
|
||||
rest=${rest#*::AtOM:SQL:Sep::}
|
||||
files[id]=${rest}
|
||||
read -u4 line
|
||||
read -u4 -r -d $'\0' line
|
||||
done
|
||||
|
||||
echo 'BEGIN TRANSACTION;' >&3
|
||||
|
||||
@ -72,18 +72,19 @@ checkwanted() {
|
||||
for destination in "${!destinationpath[@]}"
|
||||
do
|
||||
echo -ne "\rScanning destination $destination... \033[K"
|
||||
while read -r filename
|
||||
while read -r -d $'\0' filename
|
||||
do
|
||||
sqlfile=${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||
if ! Select destination_files id \
|
||||
>/dev/null \
|
||||
<<<"filename = ${filename#${destinationpath["$destination"]}/}"
|
||||
<<<"filename = ${sqlfile#${destinationpath["$destination"]}/}"
|
||||
then
|
||||
echo -e $'\r'"$filename\033[K"
|
||||
(( remove )) && rm -f "$filename"
|
||||
(( remove )) && rm "$filename"
|
||||
echo -n "Scanning destination $destination... "
|
||||
fi
|
||||
progressSpin
|
||||
done < <(find "${destinationpath["$destination"]}" -type f)
|
||||
done < <(find "${destinationpath["$destination"]}" -type f -print0)
|
||||
done
|
||||
echo -en "\r\033[K"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user