
On 13/01/2014 6:58 PM, Erik Christiansen wrote:
Ah, that is much easier to read. Just one annoying suggestion from a backseat driver; The following are equivalent:
grep '^foo' | \ awk '{print "wget -c bar "}'
and
awk '/^foo/ {print "wget -c bar "}'
I.e. The core of awk is that it is a line processor which runs blocks of C-like text processing code against those input lines which match a set of regex or literal text triggers.
Also, to simplify quoting, inclusion of shell variables can be done with:
awk -F '/^foo/ {print "wget -c bar '$2' "}'
Yes, I did that too, but didn't re-post again.
IIUC, the sed line is just adding line breaks at href tags. Setting RS to a regex (in awk) would allow awk to see the input as lines broken only at those tags, obviating the need for sed as well.
A bit of playing with RS didn't bear fruit, but then I found the page has completely changed -- so that's probably why.
Hopefully that's interesting and/or useful.
Yes, useful, but as the entire page has changed now -- much different to what it was -- so everything broke. Cheers A.