Visti
February 26th, 2009, 04:25 PM
Hi guys, I'm doing a small script and I've seem to hit a wall here:
Basically, I want to write a script to check for updates on a certain website, but only displaying the headlines in the terminal.
So looking at the site, I see that every headline has a "posted by:" line under it, so I came up with this command right here:
lynx -dump http://www.rlslog.net | grep -B2 Posted | cut -b 1-3 --complement
It just greps for the word posted and displays a few lines above it as well, while cutting off lynx's link numbering. Now this returns a bunch of not very neatly formatted headlines including both the "posted by" line, the headline I want and a space in between.
Now here's what I would like to do:
Format it using something like "head -1", but for each hit. Then it would return a nice list of just the information I want. Is this possible at all?
Can it be achieved by a script using a for loop or something similar?
Basically, I want to write a script to check for updates on a certain website, but only displaying the headlines in the terminal.
So looking at the site, I see that every headline has a "posted by:" line under it, so I came up with this command right here:
lynx -dump http://www.rlslog.net | grep -B2 Posted | cut -b 1-3 --complement
It just greps for the word posted and displays a few lines above it as well, while cutting off lynx's link numbering. Now this returns a bunch of not very neatly formatted headlines including both the "posted by" line, the headline I want and a space in between.
Now here's what I would like to do:
Format it using something like "head -1", but for each hit. Then it would return a nice list of just the information I want. Is this possible at all?
Can it be achieved by a script using a for loop or something similar?