Shell script for each sleep with no last execution

This is an example of a shell script "for" loop doing a sleep on each execution except the last one:

#!/bin/sh

PARAMS2=$*
eval LAST=$"$#"

for app in $PARAMS2
do
    echo $app
    if [ $app != $LAST ]
    then
        sleep 300
    fi
done
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License