Skip to content

Instantly share code, notes, and snippets.

@jhn--
Created February 20, 2018 06:43
Show Gist options
  • Save jhn--/e115307a75c2bfe5d566052ec6ba329a to your computer and use it in GitHub Desktop.
Save jhn--/e115307a75c2bfe5d566052ec6ba329a to your computer and use it in GitHub Desktop.
rm_listof_dir.sh
#!/bin/bash
directories=("/path/to/dir1" "/path/to/dir2")
for i in ${directories[@]};
do
if [ -d $i ]
then
echo "$i is around"
rm -fr $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment