in reply to Re: One liner: remove ssh keys with quotemeta
in thread One liner: remove ssh keys with quotemeta
remember that you are substituting ${line} in at the shell level, so any regex-terminating characters within that variable will also have to be escaped somehow
And here's my pet problem again: The problem of "the" default shell. It does not only affect perl, it is a general problem. And the solution is also generic - avoid the shell! From five minutes of Google, it seems that Puppet is written in Ruby. Ruby inherits many ideas from Perl, including a multi-argument form of exec(), including guesswork to avoid the shell when called with a single argument.
So the sane way to get the job done is to use a multi-argument exec() already at the Puppet level, i.e. exec "perl","-E","say 'your code here'".
Alexander
|
|---|