Quote:
Originally Posted by gilesaj001
I almost have it now.
I have a script that dumps the results of a query into a txt file.
Code:
#!/usr/bin
#!/bin/bash
#!/usr/sbin
cd path to script
alert="$(grep 'Warnings' --after-context=7 weather-data-advisory.txt)"
echo "$alert" > find-warnings.txt
This outputs this text at the moment as there is a warning
|
Is this really your script?
This is a single grep:
Code:
grep 'Warnings' --after-context=7 weather-data-advisory.txt > <path to script>/find-warnings.txt
The first 3 lines are wrong, useless.