Skip to content
Snippets Groups Projects
rm~all 499 B
Newer Older

# default is pwd
if [ "$#" -eq 0 ]
then
Mark Olesen's avatar
Mark Olesen committed
    set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
Mark Olesen's avatar
Mark Olesen committed
    echo "Usage: ${0##*/} [dir1] .. [dirN]"
    echo "    remove all *~ files"
    exit 1
Mark Olesen's avatar
Mark Olesen committed
    if [ -d "$i" ]
    then
        echo "removing all *~ files: $i"
        find $i \( -name '*~' -o -name '.*~' \) -print | xargs -t rm 2>/dev/null
    else
       echo "no directory: $i" 1>&2
    fi
#------------------------------------------------------------------------------