Files
2026-04-01 18:48:42 +03:00

17 lines
407 B
Bash

last=""
lastsrc=""
find -iname '*.ymp' | sort -V -r | while read line ; do
name=$(basename $line | cut -f1 -d_)
if echo $line | grep "source.ymp" >/dev/null; then
if [[ "$lastsrc" == "$name" ]] ; then
echo rm -f $line
fi
lastsrc="$name"
else
if [[ "$last" == "$name" ]] ; then
echo rm -f $line
fi
last="$name"
fi
done