in reply to Re: Perl inline replace with execution results
in thread Perl inline replace with execution results
Excellent zaxo and sk! You make it look too easy. :)
zaxo, you are right about the double quotes and that is why I had the "\" before the "$1". In my original try I had single quotes, but there I saw that it wasn't executing, but rather just replacing with exactly what I wanted to execute. So, I want to run this from the cmd line and I'll mix up what the two of you both shared.
I finally went with this (mytool.pl is in my PATH):
perl -i.bak -pe 's/^(mytool\.pl .*)/`$1`/e' test.templateNice. Thank you both!
|
|---|