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.
|
|---|
| 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 |