in reply to Re^3: safely passing args through ssh
in thread safely passing args through ssh

Well, then I guess you didn't solve the problem that I stated.

Replies are listed 'Best First'.
Re^5: safely passing args through ssh
by ikegami (Patriarch) on Jul 25, 2011 at 23:29 UTC

    The problem you stated: "what's a good way of encoding ... so that it will survive an ssh call?"

    Where "D" is the shell's literal parser and "s" is an arbitrary shell command, you want a function "E" that exhibits the following behaviour:

    s = D(E(s)) = D(D(E(s))) = D(D(D(E(s)))) etc

    but there is none.

      Why are you ignoring the entire section of my original post starting with "To be specific about the problem ..."???

      I'm not looking to encode an arbitrary shell command. Given an $array that will invoke a perl interpreter via open(..., "-|", @$array) I am looking for ways to safely encode a perl script that will be passed to the interpreter via the command line.

        Why are you ignoring the entire section of my original post starting with "To be specific about the problem ..."???

        First, that's not true. I addressed that.

        Second, I don't happen to be interested in helping you work around a bug when it's easy to fix the bug itself.

        I'm not looking to encode an arbitrary shell command.

        That's not true, you're trying to make it work with Perl and argcount.

        If it's limited to Perl, there are indeed ways.

        perl -MDecoder -edecode_and_run encoded