From 4c58fd9fae18ef789daf94ce4ad3a842bfc45267 Mon Sep 17 00:00:00 2001 From: Petar Cubela Date: Mon, 17 Jun 2024 13:05:42 +0200 Subject: [PATCH] initial commit --- error-in-logs.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 error-in-logs.sh 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"