Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- echo -e "\nThis script searches the mail logs for particular patterns or strings\n"
- read -p "Please enter the patterns you would like me to search for (separated by a comma or space): " PATTERNS
- SEARCHTERMS=$(echo $PATTERNS | sed -e 's/ /|/g' -e 's/,/|/g)
- if [ -n "$PATTERNS" ]
- then
- zegrep -si "$SEARCHTERMS" /var/log/messages*
- else
- echo you must enter at least one search term!
- fi
- exit
Advertisement
Add Comment
Please, Sign In to add comment