Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking Unanswered: How to trap ^C in ksh

    Hi experts,

    How can I trap the control-C in a ksh script in SunOS?

    (man trap does not provide the answer)

    Thanks,
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    I always trap 1 2 and 15. I forget which is which but one is ctrl+c.

  3. #3
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    And the answer is... 2

    i.e.

    trap "echo ctrl+c was pressed" 2

  4. #4
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525

  5. #5
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Thumbs up

    Thanks a mil guys!
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •