in reply to Re^2: One liner: remove ssh keys with quotemeta
in thread One liner: remove ssh keys with quotemeta

Hey mate,

thanks for that.
It turns out you were right and in fact we don't need to do all the escapes / quotemeta stuff !
I can't believe it's that simple - I was convinced the previous guy was on the right track...

To be fair, I've done a lot of Perl programming in the past, but almost never one liners like this (especially also having to worry about passing it through the shell etc).

Final code (inside puppet)
exec { "/usr/bin/perl -i -lne 'print unless \$_ eq q($line)' '${file} +'":
BTW, that -l switch is magic :)

Cheers
Chris