I have a bash script where I'm zipping some files. This process sometimes takes time depending on the file sizes. I want to get the pid of this command and display a flashing message "Zipping..." until the process completes, something like the following:
zip -r test.zip *.php > /dev/null &
pid=$!
while (kill -0 $pid)
do clear
sleep 1
echo "Zipping......."
sleep 1
done
Is $pid the accurate PID of the zip command I'm running?

sleep, so it'd besleep 1. – Wuffers May 7 '11 at 21:26