M
Mike Pearson
Hi -
I know almost no Perl at all, but I occasionally use
perl -pi -e 's/old/new/g' file
for a global search/replace in a file. I've tried to modify this to
change only a string on the first line of a file, leaving the string
unchanged elsewhere in the file, but I haven't been able to find a way
to do this. Simply removing the 'g' has no effect - it still does a
global replace.
Can anyone tell me how to do this?
Thanks -
Mike
I know almost no Perl at all, but I occasionally use
perl -pi -e 's/old/new/g' file
for a global search/replace in a file. I've tried to modify this to
change only a string on the first line of a file, leaving the string
unchanged elsewhere in the file, but I haven't been able to find a way
to do this. Simply removing the 'g' has no effect - it still does a
global replace.
Can anyone tell me how to do this?
Thanks -
Mike