in reply to what difference does a command run in shell and in perl

The problem is that the backslashes are interpolated inside perl as a part of the back-quotes `` expression with the result that what gets passed to the shell look like this:

psed -e 's/\///gp' init10CONVERGE.ora > init10CONVERGE.ora_for_unix

Which isn't going to do what you intended. To avoid that, double escape the regex:

`psed -e 's/\\\\/\\//gp' init10CONVERGE.ora > init10CONVERGE.ora_for_u +nix`;

That said, as you are redirecting the output to a file, why are you using back-quotes? system would be more appropriate.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: what difference does a command run in shell and in perl
by xiaoyafeng (Deacon) on May 22, 2011 at 05:58 UTC
    ah~~ I see! Thanks very much! As back-quotes thing, it is just for test. I'll declare variables like $command, @pars etc and pass to system function.




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction