in reply to Re^3: Multiple commands with one system call
in thread Multiple commands with one system call

I think when you make the echo call. System calls echo 1 finishes and then calls echo 2. In my case however my first program doesn't finish, I actually have to make the second call while the first one is running. Which is what makes it a bit challenging since the second call will not happen until the first one is done.

  • Comment on Re^4: Multiple commands with one system call

Replies are listed 'Best First'.
Re^5: Multiple commands with one system call
by kennethk (Abbot) on Sep 29, 2011 at 22:09 UTC
    Then at the very least, you need a fork or threads. Depending on some very practical details, I would probably use IPC::Open2 to monitor progress of the child progress so you know when to execute your secondary commands. Some details of interprocess communication are discussed in perlipc.
Re^5: Multiple commands with one system call
by shriken (Priest) on Sep 30, 2011 at 13:39 UTC
    if Perl detects any shell meta-characters, it forks-and-exec a shell to handle the command. So you can jam a series of shell commands into your system() call. Note that I said "can", not "this is a good idea." ;)