From 82568c216681f4b77ef8b681cf01e7c30cc2a619 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Thu, 25 Nov 2021 06:18:51 -0800 Subject: [PATCH] script --- scripts/remove_dir_with_match.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/remove_dir_with_match.sh diff --git a/scripts/remove_dir_with_match.sh b/scripts/remove_dir_with_match.sh new file mode 100755 index 0000000..e6f29e1 --- /dev/null +++ b/scripts/remove_dir_with_match.sh @@ -0,0 +1,8 @@ +# remove a directory if it contains a file that matches grep + +for d in *; do + grep -R "coordinate integer" $d > /dev/null + if [[ 0 = $? ]]; then + rm -rfv $d + fi +done \ No newline at end of file