From d3924a4bbfd1467b86b12479d339c73c435707b5 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Mon, 29 May 2017 21:53:02 +0100 Subject: [PATCH] Scripts in bin: added -help and -0 on xargs --- bin/rmcore | 22 +++++++++++++++++----- bin/rm~all | 18 +++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/bin/rmcore b/bin/rmcore index 2a1feeed5..d732a73cd 100755 --- a/bin/rmcore +++ b/bin/rmcore @@ -29,24 +29,36 @@ # remove all core files #------------------------------------------------------------------------------ +usage() { + cat</dev/null + find $i \ + \( \ + -type f \ + -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \ + \) -print0 | \ + xargs -t -0 rm 2>/dev/null else echo "no directory: $i" 1>&2 fi diff --git a/bin/rm~all b/bin/rm~all index 33ed86b0d..77a93777d 100755 --- a/bin/rm~all +++ b/bin/rm~all @@ -29,24 +29,32 @@ # remove all *~ files #------------------------------------------------------------------------------ +usage() { + cat</dev/null + find $i \( -name '*~' -o -name '.*~' \) -print0 | \ + xargs -t -0 rm 2>/dev/null else echo "no directory: $i" 1>&2 fi