8 ago 2011

Shell scripts secuenciales


#We launch script in background
./twitter_json.sh&

#Capture its PID
pid="${!}"

#This waits until the program with the given PID ends
wait $pid

#We launch script in background
./fbook_json.sh&

28 jul 2011

Help Running Programs In Sequential Order

#!/bin/bash

#We launch glxgears on the background
glxgears&

#Capture its PID
pid="${!}"

#This waits until the program with the given PID ends
wait $pid

#Here we put more instructions, these will not be run until
#the wait command above unlocks the shell
echo "glxgears was closed, it's pid was $pid"