From: Chris Koeritz Date: Wed, 6 Jan 2016 03:23:19 +0000 (-0500) Subject: new function for changing into a directory and removing a set of files there. a... X-Git-Tag: 2.140.90~553 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=140849126a852d59c52670fd1e254f198829be29;p=feisty_meow.git new function for changing into a directory and removing a set of files there. a handy op. --- diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 68cdd1d5..d6beda88 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -467,6 +467,16 @@ if [ -z "$skip_all" ]; then sed -i -e "s%$pattern%$replacement%g" "$file" } + # goes to a particular directory passed as parameter 1, and then removes all + # the parameters after that from that directory. + function push_whack_pop() + { + local dir="$1"; shift + pushd "$dir" &>/dev/null + rm $* &>/dev/null + popd &>/dev/null + } + function spacem() { while [ $# -gt 0 ]; do