diff --git a/bin/rmclassall b/bin/rmclassall index 5ee1c73629..059306bee5 100755 --- a/bin/rmclassall +++ b/bin/rmclassall @@ -1,2 +1,24 @@ #!/bin/sh -find . \( -name '*.class' \) -print | xargs -t rm + +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo " remove all .class files" + exit 1 +fi + +for i +do + if [ -d "$i" ] + then + echo "removing all .class files" + find $i -name '*.class' -print | xargs -t rm + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------ diff --git a/bin/rmcore b/bin/rmcore index 1245878ff3..f34cae57a5 100755 --- a/bin/rmcore +++ b/bin/rmcore @@ -1,3 +1,25 @@ #!/bin/sh -# find . \( -name 'core' \) -exec ls -l {} \; -exec rm {} \; -find . \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm + +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo " remove all core files" + exit 1 +fi + +for i +do + if [ -d "$i" ] + then + echo "removing all core files" + find $i \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------ + diff --git a/bin/rmdepall b/bin/rmdepall index 84e6526741..4cfa1ad680 100755 --- a/bin/rmdepall +++ b/bin/rmdepall @@ -1,15 +1,19 @@ #!/bin/sh -if [ $# -eq 0 ] +if [ "$1" = "-h" -o "$1" = "-help" -o "$#" -gt 1 ] then - find . \( -name '*.dep' \) -print | xargs -t rm -elif [ $# -eq 1 ] -then - echo "Removing all dep files containing $1..." - find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \; -else - echo "Usage: ${0##/} to remove all .dep files" - echo " ${0##/} to remove all .dep files referring to " + echo "Usage: ${0##*/} : remove all .dep files" + echo " ${0##*/} : remove all .dep files referring to " exit 1 fi +if [ "$#" -eq 0 ] +then + echo "removing all .dep files" + find . -name '*.dep' -print | xargs -t rm +else + echo "removing all .dep files containing $1..." + find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \; +fi + +#------------------------------------------------------------------------------ diff --git a/bin/rmoall b/bin/rmoall index 636e055e5b..32bd804788 100755 --- a/bin/rmoall +++ b/bin/rmoall @@ -1,2 +1,24 @@ #!/bin/sh -find . \( -name '*.o' \) -print | xargs -t rm + +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo " remove all .o files" + exit 1 +fi + +for i +do + if [ -d "$i" ] + then + echo "removing all .o files: $i" + find $i -name '*.o' -print | xargs -t rm + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------ diff --git a/bin/rm~all b/bin/rm~all index 6ee2bad370..0725382447 100755 --- a/bin/rm~all +++ b/bin/rm~all @@ -1,3 +1,24 @@ #!/bin/sh -# find . \( -name '*~' -o -name '.*~' \) -exec ls -l {} \; -exec rm {} \; -find . \( -name '*~' -o -name '.*~' \) -print | xargs -t rm + +# 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" + find $i \( -name '*~' -o -name '.*~' \) -print | xargs -t rm + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------ diff --git a/bin/touchapp b/bin/touchapp index 38325105ef..6c76f2208a 100755 --- a/bin/touchapp +++ b/bin/touchapp @@ -1,3 +1,17 @@ #!/bin/sh -touch $FOAM_APPBIN/* +if [ "$#" -ne 0 ] +then + echo "Usage: ${0##*/}" + echo " touch FOAM_APPBIN" + exit 1 +fi + +if [ -d "$FOAM_APPBIN" ] +then + echo "touching FOAM_APPBIN: $FOAM_APPBIN" + touch $FOAM_APPBIN/* +else + echo "no FOAM_APPBIN: $FOAM_APPBIN" +fi +#------------------------------------------------------------------------------ diff --git a/bin/touchdep b/bin/touchdep index 25d4b75fa4..497fae79ee 100755 --- a/bin/touchdep +++ b/bin/touchdep @@ -1,3 +1,24 @@ #!/bin/sh -find . \( -name '*.dep' \) -print | xargs -t touch +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo " touch all .dep files" + exit 1 +fi + +for i +do + if [ -d "$i" ] + then + echo "touching all .dep files: $i" + find $i -name '*.dep' -print | xargs -t touch + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------ diff --git a/bin/touchlib b/bin/touchlib index bda6880c96..ef4a7cc6fe 100755 --- a/bin/touchlib +++ b/bin/touchlib @@ -1,3 +1,17 @@ #!/bin/sh -touch $FOAM_LIBBIN/* +if [ "$#" -ne 0 ] +then + echo "Usage: ${0##*/}" + echo " touch FOAM_LIBBIN" + exit 1 +fi + +if [ -d "$FOAM_LIBBIN" ] +then + echo "touching FOAM_LIBBIN: $FOAM_LIBBIN" + touch $FOAM_LIBBIN/* $FOAM_LIBBIN/*/* +else + echo "no FOAM_LIBBIN: $FOAM_LIBBIN" +fi +#------------------------------------------------------------------------------ diff --git a/bin/toucho b/bin/toucho index bf3a69f6d8..0236225d73 100755 --- a/bin/toucho +++ b/bin/toucho @@ -1,3 +1,24 @@ #!/bin/sh -find . \( -name '*.o' \) -print | xargs -t touch +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo " touch all .o files" + exit 1 +fi + +for i +do + if [ -d "$i" ] + then + echo "touching all .o files: $i" + find $i -name '*.o' -print | xargs -t touch + else + echo "no directory: $i" + fi +done +#------------------------------------------------------------------------------