in reply to Trying to understand the System function

When I run the following script I get errors when I use the list form if the system call.

You are using shell redirection (via '>') and backgrounding (via '&'). When you use the system LIST form, a shell is not started. The ps command doesn't know what to do with the '>' and '&' arguments you are giving it.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: Trying to understand the System function

Replies are listed 'Best First'.
Re: Re: Trying to understand the System function
by mifflin (Curate) on Jul 28, 2003 at 18:15 UTC
    So if we forget the redirection (via >) right now, how would I execute a command in background using the list form of the system command?
    Is this possible?

      Don't use system. Just fork and exec instead.

      -sauoq
      "My two cents aren't worth a dime.";