in reply to One liner: remove ssh keys with quotemeta
This is another case where Perl probably is not the right tool for the job and you would be better off using sed than bringing up an entire perl instance just for one exact match. Try something like:
exec { "/bin/sed -i -e '\\%${line}%d' '${file}'" : ... }
Your problem seems to be the presence of the regex delimiter in some of the data that you need to match. Try using a different delimiter — in Perl /$pat/ is shorthand for m/$pat/ and you can replace it with m[$pat]. See perlsyn and perlop for more details.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One liner: remove ssh keys with quotemeta
by afoken (Chancellor) on Nov 29, 2019 at 12:35 UTC | |
by jcb (Parson) on Nov 29, 2019 at 17:25 UTC | |
by afoken (Chancellor) on Nov 29, 2019 at 19:36 UTC |