#!/usr/bin/env bash
old_var="zzz"
var="xxx"
[ -n "${1}" ] && CMD="echo Dryrun: "
while read a; do
var="$(basename "${a}")"
[ "${var}" == "${old_var}" ] && ${CMD} rm -v "${a}" || old_var="${var}"
done < <(find . -type f | rev | sort -t'/' -k 1 | rev)
No comments:
Post a Comment