preventing "break" in a script

Not sure if I am using the correct terminology:

I have a user setup in a menu. I want to let the user browse a file using the pg.

I want to prevent the person from doing <ctrl>c and being able to exit the script to the command line.

How do I do this?

man trap.

you can also do a search on this site for that command.

Interesting. No man pages on trap on my servers.
:mad:

syntax
trap "command to run when signal trapped" "list of signals"

trap "" signals # Will trap the signals you define but not allow them to affect your script.

you can get a list of signals by typing kill -l on the command line. Note: You cannot trap signal 9. Your "command to run" can be a function if you so choose.

The syntax depends on your shell. If you are using ksh, you would do a "man ksh".

the man page gives examples for various shells.


User Commands                                             trap(1)

NAME
     trap, onintr  -  shell  built-in  functions  to  respond  to
     (hardware) signals

SYNOPSIS
  sh
     trap [  argument  n  [ n2 ... ]  ]

  csh
     onintr [ -| label ]

  ksh
     *trap [  arg sig  [  sig2 ...  ]  ]

Yeah, but only Sun has that trap man page. At least it's not on HP. On linux I get a bash man page with "man trap".