mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- send error messages to stderr - added -h/-help options where some were missing - changed 3-space to 4-space indentation - where possible, allow multiple directories from the command-line
26 lines
499 B
Bash
Executable File
26 lines
499 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# default is pwd
|
|
if [ "$#" -eq 0 ]
|
|
then
|
|
set -- .
|
|
elif [ "$1" = "-h" -o "$1" = "-help" ]
|
|
then
|
|
echo "Usage: ${0##*/} [dir1] .. [dirN]"
|
|
echo " remove all *~ files"
|
|
exit 1
|
|
fi
|
|
|
|
for i
|
|
do
|
|
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
|
|
done
|
|
|
|
#------------------------------------------------------------------------------
|