aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/trap.txt
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-12-18 07:30:52 +1000
committerGravatar axel <axel@liljencrantz.se>2005-12-18 07:30:52 +1000
commit7bdcfacee4cbed0e90e09a6bcb3ab0dd7f01ae5a (patch)
tree18086d0a96fbc7fb5c29020843bea008a8405b8c /doc_src/trap.txt
parent61706b44902be4c8b423b0c1ad8e9a34ee1a5a5f (diff)
Add trap shellscript function
darcs-hash:20051217213052-ac50b-fdab838ea9595fac7572068ea3a1f12b8bb0ea68.gz
Diffstat (limited to 'doc_src/trap.txt')
-rw-r--r--doc_src/trap.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc_src/trap.txt b/doc_src/trap.txt
new file mode 100644
index 00000000..dd4d2fe8
--- /dev/null
+++ b/doc_src/trap.txt
@@ -0,0 +1,37 @@
+
+\section trap trap - perform an action when the shell recives a signal
+
+\subsection trap-synopsis Synopsis
+<tt>trap [OPTIONS] [[ARG] SIGSPEC ... ]</tt>
+
+\subsection trap-description Description
+
+Trap is a shellscript wrapper around the fish event delivery
+framework. IT is defined for backwards compatibility reasons. For
+other uses, it is recomended to define a <a
+href='index.html#event'>event handler</a>.
+
+- ARG is the command to be executed on signal delivary
+- SIGSPEC is the name of the signal to trap
+- \c -h or \c --help Display help and exit
+- \c -l or \c --list-signals print a list of signal names
+- \c -p or \c --print print all defined signal handlers
+
+If ARG and SIGSPEC are both specified, ARG is the command to be
+executed when the signal specified by SIGSPEC is delivered.
+
+If ARG is absent (and there is a single SIGSPEC) or -, each specified
+signal is reset to its original disposition (the value it had upon
+entrance to the shell). If ARG is the null string the signal
+specified by each SIGSPEC is ignored by the shell and by the commands
+it invokes.
+
+If ARG is not present and -p has been supplied, then the trap commands
+associated with each SIGSPEC are displayed. If no arguments are
+supplied or if only -p is given, trap prints the list of commands
+associated with each signal.
+
+Signal names are case insensitive and the SIG prefix is optional.
+
+The return status is 1 if any SIGSPEC is invalid; otherwise trap
+returns 0.