It could be better:
./app1 & ; ./app2 &
But, as mentioned, the shell will start each of them as child processes in the sub-shell. Shell does not guarantee that there is any synchronization between processes or startup time.
Why do you need them to work in parallel? Perhaps understanding this requirement will give you a better answer.
You can create a very simple startup synchronization in two programs. Here is the example "app1" in the example.
#!/bin/sh # app1.sh # Do any setup, open log files, check for resources, etc, etc... # Sync with the other app typeset -i timeout=120 count=0 touch /tmp/app1 while [[ ! -e /tmp/app2 ]] ; do if [[ $count -ge $timeout ]] ; then print -u2 "ERROR: Timeout waiting for app2" exit 1 fi (( count += 1 )) sleep 1 done # Do stuff here... # Clean up rm /tmp/app1 exit 0
source share