Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://comet.sai.msu.ru/UNIXhelp/scrpt/scrpt2.9.2.html
Дата изменения: Fri Jan 17 12:43:20 1997 Дата индексирования: Tue Oct 2 01:16:34 2012 Кодировка: Поисковые слова: hst |
The command list is placed between single quotes, as the command line is scanned twice, once when the shell first encounters the trap command and again when it is being executed.
trap 'command-list' signal-list
The single quotes inhibit immediate command and variable substitution but are stripped off after the first scan, so that the commands are processed when the command is actually executed.
If command-list is not specified, then the action taken on receipt of any signal in the signal-list is reset to the default system action.
If command-list is an explicitly quoted null command (' ' or " "), then the signals in signal-list are ignored by the shell.
The command-list is treated like a subroutine call. The commands in the list are executed when the signal is trapped and control is then returned to the place at which it was interrupted.