#!/bin/bash
                                                                                        
## Yr basic friendly error output.
help_output() {
    echo "$0 is a bash script which keeps an ssh or other interactive session"
    echo "alive by echoing control returns every once in a while. You may specify"
    echo "the amount of time on the command line in seconds. The default value is"
    echo "60 seconds. Press ENTER to quit."
}

## Program flow begins here: int main etc
## Set up options.
TIME=60
help_output
if [ $1 ]; then
    TIME=$1
fi
while ! read -t $TIME -a BAR ; do
    if [ -z $REPLY ]; then
        echo
    else
        exit
    fi
done
