From 140849126a852d59c52670fd1e254f198829be29 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 5 Jan 2016 22:23:19 -0500 Subject: [PATCH] new function for changing into a directory and removing a set of files there. a handy op. --- scripts/core/functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.34.1