#!/bin/sh LASTBASE="" find $1 -type f -print | rev | sort | rev | while read FILE do BASE=$(basename "$FILE") if [ "$BASE" = "$LASTBASE" ]; then rm "$FILE" LASTBASE="$BASE" done
#!/bin/sh LASTBASE="" find $1 -type f -print | rev | sort | rev | while read FILE do BASE=$(basename "$FILE") if [ "$BASE" = "$LASTBASE" ]; then rm "$FILE" LASTBASE="$BASE" done