in reply to Trying to understand the System function

Doesn't the ampersand as the last char put the command you're trying to execute into the background?

If that's what you really want, perhaps you should be looking at fork().

UPDATE: feh, I sould have said, are you trying to run this thing in the background? In any case, '&' is certainly not the way to do that.

  • 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:07 UTC
    Yes, the & does mean run in background.
    I want that there because I don't want to wait for the command to finish. I want to execute it and continue immediately regardless of how long the command will take.
    P.S. Don't let the 'ps' command in the example cloud the issue. The command I send is not important. What is important is that I am able to execute a command and get a response back to the user that it was started, not that it finished. I was hoping to use the list form of system to get rid of any 'shell' issues with quoting or any other special chars. Maybe & is a special shell char?