Hi Theo,
> sed --in-place -e '/^Checksum/,/^Directory/ {/^Directory/b;d}' files
>
> My regexps aren't up to working out exactly what this line is intended
> to do, but it's clearly doing the wrong thing. Can anyone suggest
> what it's supposed to do?
I don't know the author's intention but it will delete lines from the
one starting with Checksum to just before the next one that starts
Directory; just as your capture shows. It could be re-written as
/^Checksum/,/^Directory/{/^Directory/!d}
"For every line between Checksum and Directory inclusive, if it doesn't
match Directory then delete it." IOW, make it inclusive at the start
and exclusive at the end. If awk's more your thing,
awk '/^Checksum/ {f = 1} /^Directory/ {f = 0} !f'
Perhaps the author expects a different order of headers in the input?
Cheers, Ralph.
_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK