Skip to content

Instantly share code, notes, and snippets.

@jornane
Created August 31, 2017 18:54
Show Gist options
  • Save jornane/c2e52ec14e92e2d9fd999b40c8d43851 to your computer and use it in GitHub Desktop.
Save jornane/c2e52ec14e92e2d9fd999b40c8d43851 to your computer and use it in GitHub Desktop.
#!/bin/sh
find ~/Documents/Textual\ Logs -type f -name \*.txt | while read file
do
test -z "$(grep -v '————————————— Begin Session —————————————' "$file" | grep -v '————————————— End Session —————————————' | grep -v '^ $' )" && rm "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment