commit 4c58fd9fae18ef789daf94ce4ad3a842bfc45267 Author: Petar Cubela Date: Mon Jun 17 13:05:42 2024 +0200 initial commit diff --git a/error-in-logs.sh b/error-in-logs.sh new file mode 100644 index 0000000..040691d --- /dev/null +++ b/error-in-logs.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Define the log file to search +log_file="/var/log/syslog" + +# Define the error keyword to search for +error_keyword="ERROR" + +# Should return the line(s) with ERROR in them. +grep -n "$error_keyword" "$log_file"