tricks!

i’ve just discovered sed. this thing is wonderful; it’s like an in-line perl on the command-line. now, it looks like i can use the shell to do things that even a perl program would be overkill for.
for instance, i’ve got these files:

note that there are some small things to note about this sed command if you’re coming from a perl background. first, you need to escape out the parentheses for matching. second, sed doesn’t seem to know about “\d”; you instead have to just write “[0-9].” third, sed also doesn’t know about “+”; you’ll have to just settle for “*” to do multi-character matches. fourth, you can’t print the match using “$1″ like in perl; instead, you write “\1″.