i am new to scripting and i had to create a shell script which has configurable path, log file name and search string and after every 5 min it should send an email if any alerts(in this case if we find the search string) but it should also search only last 6 mins log only after every 5 mins
This is often accomplished by using environmental vars, or reading a config file.
This would generally be accomplished as an argument to the script you are developing.
This is generally done using cron' and the
crontab` file.
This can be easily done using one of the many mail tools available, depending on your system and OS.
This is accomplished by filtering the log file before you search for the string, removing all the entries older than your date range. How to do this is based on the format if your log file and how it timestamps the log entries.
If you are "new to scripting" then I suggest this task looks like it is undeclared homework.
Homework must be declared as homework / school-related work when you first post it. Did you read the rules?
this is work related task not homework
Continued here: