in reply to How to avoid to launch a unix shell script in a perl script

I'm confused. Are you having a problem running enter.sh or cmd_proc_shell? It sounds like you are having problems with latter, but then there'd be no reason to mention the former.

Assuming your problem is with cmd_proc_shell, how do you want to run it? Specifically, do you need to capture its output, do you need to know its error code, do you want to wait for it to finish running before continuing, and are you on a Windows system or not?

If you don't need to capture its output and you don't mind waiting for it to finish running before continuing,

Unix: system('cmd_proc_shell', 'enter 0,1,0'); Windows system('cmd_proc_shell "enter 0,1,0"');

In unix, the quotes you passed to the shell aren't seen by the program. The shell splits the command into arguments, unquotes everything, and passes the arguments as an array. In Windows, it's the program's responsibility to handle its own command line parsing.

Replies are listed 'Best First'.
Re^2: How to avoid to launch a unix shell script in a perl script
by bertigo (Novice) on May 06, 2008 at 10:03 UTC
    The script run on unix; the cmd_proc_shell has to be launched on background otherwise the command wait a CTRL-C. I don't need to capture the output nor the error code.
      fork || exec("cmd_proc_shell");
        That would be fork || exec('cmd_proc_shell', 'enter 0,1,0');, and you'll need to call waitpid or set $SIG{CHLD} = 'IGNORE'; at least.
        Thanks a lot That is the answer i expected.