Hi,
I'm just teaching myself sed and awk (mostly sed, now), and I'm
trying to do something like the following:
sed -e '
s/\(Ch\.\)\(.*\)/ Chapter $((chapnum+1)) \2/g
s/\(Part\.\)\(.*\)/Part $((partnum+1)) \2/g' $filename
$filename will have "Ch" that I want to consecutive Chapter
numbers. Same with "Part", which I want to change to consecutive
Section or Part numbers. Can this kind of substitution be done
with sed? I suspect it can with awk, but I'm not there yet. I'm
sure it can be done with Perl quite easily, but I'm trying to use
shell tools if I can, just for the exercise. :-)
TIA!
--
David S. Jackson http://www.dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Out eth0, through the firewall, over the analog line, into usr1, past
another firewall, through the gateway, out the T-3, off core2 in
Atlanta . . . nothin' but Net."
---
http://www.kernel-panic.com
list archives http://www.ultraviolet.org
To unsubscribe, send a message to the address shown in the list-unsubscribe
header of this message.
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.