If it's not on-topic, it's in here.
Post a reply
nadir

- nadir
- Posts: 1141
- Joined: Wed Mar 09, 2011 4:18 am
- Location: here

## again a basch script question

Sun Nov 13, 2016 8:45 am

What i do is this:
if lynx -dump -nolist some-http-webpage | grep "$TERM"
then
echo "found $TERM at some-http-webpage
fi
What i would like is to
store the result of lynx -dump in a file
and
if the file is elder than a week, use lynx again
else
grep through the file
thanks.
fsmithred

- fsmithred
- Posts: 1886
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: again a basch script question

Sun Nov 13, 2016 9:03 pm

Redirect the wget output to file, then grep the file for $TERM
Before you do that, use 'find -mtime <whatever a week ago looks like> -name same-file-as-above' and based on the result, either grep the file or wget it and grep it. You can use mtime to find files up to some time in the past or beyond some time in the past. Been awhile since we done this, huh?
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.