Run two things simotaniously via one shell script?

Discussion in 'macOS' started by dmmcintyre3, Apr 17, 2009.

  1. dmmcintyre3 macrumors 68020

    Joined:
    Mar 4, 2007
    #1
    Can you run two things simotaniously via one shell script?
     
  2. mason.kramer macrumors 6502

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #2
    Simultaneously, I think you mean. You can background the first task with &.

    #!/bin/bash
    sleep 5
    echo after sleep, the echo

    ------

    #!/bin/bash
    sleep 5 &
    echo echoing immediately
     

Share This Page