in reply to Re^4: Execute by order
in thread Execute by order

...at its simplest, by changing command to command &.

However, by just doing the above, the backgrounded command will suspend if it needs to write to either device 1 or device 2 (STDOUT/STDERR in perl parlance), or read from device 0 (STDIN), so command is usually rewritten as command >file 2>&1 & to send all output from stdout and stderr to file.

If you don't care about output from either stdout or stderr, the frequently seen idiom - command >/dev/null 2>&1 & - is used.

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^6: Execute by order
by BrowserUk (Patriarch) on Aug 13, 2009 at 14:06 UTC
    ...at its simplest, by changing command>/c> to <c>command &

    The equivalents on Win* are:

    1. start command
    2. start command > file 2>&1
    3. start command > nul  2>&1

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      TFT BrowserUk ,

      start looks familiar, but the *NIX-like re-direction syntax ? Is it/has it been recently introduced ?

      A user level that continues to overstate my experience :-))
        but the *NIX-like re-direction syntax ? Is it/has it been recently introduced ?

        No. It's been in cmd.exe for the last 16 years!

        And it(*) was in command.com for under DOS for 10 years or more before that. My memory doesn't recall whether it was a part of DOS v1.0, I think you may have had to wait until v1.25 circa. 1983.

        (*)Albeit a somewhat broken implementation that used files rather than memory for the transfer buffers.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.