20 lines
423 B
Bash
Executable File
20 lines
423 B
Bash
Executable File
#!/bin/bash
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
if [ $# == 1 -a "$1" == --help ]; then
|
|
echo "rmtildes: supprimer les fichiers *~ dans le répertoire courant
|
|
|
|
USAGE
|
|
rmtildes [dir [glob]]
|
|
|
|
Par défaut, dir==. et glob==*~"
|
|
exit 0
|
|
fi
|
|
|
|
RM_OPTS="${RM_OPTS:--f}"
|
|
|
|
basedir="${1:-.}"
|
|
pattern="${2:-*~}"
|
|
|
|
find "$basedir" -type f -name "$pattern" -print -exec /bin/rm $RM_OPTS "{}" \;
|