I have trouble solving a little problem
        that I have.  I want to write a script (
        doesn't really matter which shell ),
        which will do some action until a key
        is pressed ( or some command entered
        like 'abort' ).  
        At first, seemed like a simple idea, but
        once I tried my hand at it -- to no
        avail.
        Any ideas on how to solve the problem?


#!/bin/bash
funtime()
{
echo OK guys, we got the ctrl-C
exit 0
}

trap funtime 2

while true
do
  date
  sleep 1
done

--
##############################################################
# Antonomasia   [EMAIL PROTECTED]                      #
# See http://www.notatla.demon.co.uk/                        #
##############################################################


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to