new function for changing into a directory and removing a set of files there. a...
authorChris Koeritz <fred@gruntose.com>
Wed, 6 Jan 2016 03:23:19 +0000 (22:23 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 6 Jan 2016 03:23:19 +0000 (22:23 -0500)
scripts/core/functions.sh

index 68cdd1d5461b6f8aa18b4f4b60543ae2be3dac20..d6beda886cd5326e00e268dc87d839eda5d165a6 100644 (file)
@@ -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