I got the below script to find the duplicates from this question
#!/bin/bash
declare -A arr
shopt -s globstar
for file in **; do
[[ -f "$file" ]] || continue
read cksm _ < <(md5sum "$file")
if ((arr[$cksm]++)); then
echo "rm $file"
fi
done
I need to know what this line does
if ((arr[$cksm]++));
How does that append to the array? can i try printing the elements stored in that array? I know appending to an array this way
ARRAY+=('foo')
Does the above script use different kind of array?
Please help
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 253
تاريخ: جمعه
28 خرداد
1395 ساعت: 17:00