I have a file with the following contents
$(CP) "$(O_SSL)" "$(INSTALLTOP)\bin"
$(CP) "$(O_CRYPTO)" "$(INSTALLTOP)\bin"
I want to add the following lines (order doesn't matter)
$(CP) "$(SSL).pdb" "$(INSTALLTOP)\bin"
$(CP) "$(CRYPTO).pdb" "$(INSTALLTOP)\bin"
So, using perl, I created the following command (which must be run from the command prompt):
perl -pi.bak -e 's#\t\$\(CP\) "\$\(O_([^)]+)\)" "\$\(INSTALLTOP\)\\bin"#$&\n\t\$(CP) "\$($1).pdb" "\$(INSTALLTOP)\\bin#g' ntdll.mak
But I just get the following error
Can't find string terminator "'" anywhere before EOF at -e line 1.
The system cannot find the path specified.
I tried replacing the single quotes with double quotes (and doubling all internal doublequotes) as so
perl -pi.bak -e "s#\t\$\(CP\) ""\$\(O_([^)]+)\)"" ""\$\(INSTALLTOP\)\\bin""#$&\n\t\$(CP) ""\$($1).pdb"" ""\$(INSTALLTOP)\\bin""#g" ntdll.mak
but I just get the following error instead
Substitution pattern not terminated at -e line 1.
How should I do this? (... I don't want to create a separate script file, but I'll do it if there's no other (reasonable) way)