Weaver, Walt wrote:
Okay, so I do a "perl -pi -e 's/$/;/g' <filename>" to try and append a
Untested but off hand somethign along the lines of: perl -pi -e 's/(.)$/\1\;/g' <filename>
semicolon to the end of each record in a file in Linux.
It does that just fine. Unfortunately it also prepends a semicolon onto
the beginning of each record too.
Now, I can vi the file and do a ":%s/$/;/g" and it works just fine.
Why does Perl put a semicolon at the end AND beginning of each line? I
have a feeling it involves the newline character but I''m not sure just
how yet.
I bet one of the smarter folks can help you with the reasons why :)
I'm starting out with one-liners and working my self up to an actual script here. :>)
Cool! Perl rocks!
Thanks, --Walt
HTH
Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>