Capturing a ^C to break out of a script?

James McDonald james_mcdonald
Mon May 17 11:33:55 PDT 2004


Umm I was wondering if there is anyway of breaking out of a script by 
capturing the CTRL+C combination and completey exiting the script I am 
running the following and if the login fails it still trys to go through the 
entire 'for in do'

Thanks

#!/bin/sh
# login to cvs

me=$0

export CVSROOT=:pserver:guest at cvs.openoffice.org:/cvs


cvs login

for  i in `echo *`

do
        echo Checking Out $i
        cvs -z3 co -PA $i
done

cvs logout

echo "$0 Done"

-- 
  James McDonald
  MCSE (Windows 2000/NT4), CCNA, CCA, MCP + I
  Registered Linux User #209832
  http://jamesmcd.dns2go.com (home)
  Red Hat Linux release 7.2 (Enigma)
  8:44pm  up 11:41,  7 users,  load average: 0.28, 0.10, 0.03




More information about the Linux-users mailing list