Return to Snippet

Revision: 4552
at January 6, 2008 10:11 by nohn


Initial Code
#!/bin/bash
/bin/false &
PID1=$!
/bin/true &
PID2=$!
wait $PID1
RET1=$?
wait $PID2
RET2=$?
if [ $RET1 == 0 ] && [ $RET2 == 0 ]; then
    echo succeeded
    exit 0
else
    echo failed
    exit 1
fi

Initial URL


Initial Description
Execute multiple commands in background, wait for each to be finished and evaluate their return codes.

Initial Title
Execute multiple commands in background and evaluate their return codes

Initial Tags
Bash

Initial Language
Bash