From a43216278137fe399cdcea6210e580b445e16197 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Mon, 23 Nov 2020 23:27:31 +0000
Subject: New forstdin; new trap; prepare for 2.7.0.0
---
doc/forstdin.html | 4 +++-
doc/index.html | 4 ++--
doc/trap.html | 25 ++++++++++++-------------
doc/upgrade.html | 10 ++++++++++
4 files changed, 27 insertions(+), 16 deletions(-)
(limited to 'doc')
diff --git a/doc/forstdin.html b/doc/forstdin.html
index 5228aee..f57ee9c 100644
--- a/doc/forstdin.html
+++ b/doc/forstdin.html
@@ -30,7 +30,7 @@ run another program.
- forstdin [ -p | -o okcodes | -x breakcodes ] [ -n ] [ -C | -c ] [ -0 | -d delim ] variable loop...
+ forstdin [ -p | -o okcodes | -x breakcodes ] [ -e eofcode ] [ -n ] [ -C | -c ] [ -0 | -d delim ] variable loop...
@@ -63,6 +63,8 @@ not listed in okcodes, forstdin will exit immediately with an
option, but with inverted meaning - the listed exit codes are codes
that will make forstdin break the loop and exit, and the unlisted exit
codes will make it keep looping.
+ - -e eofcode : if forstdin reads EOF,
+exit eofcode. Default is 0.
- Other options are used to control
the substitution mechanism for every x. Of course, you can't
split x.
diff --git a/doc/index.html b/doc/index.html
index cb411a6..c04c9d7 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -51,7 +51,7 @@ shell's syntax, and has no security issues.
- A POSIX-compliant system with a standard C development environment
- GNU make, version 3.81 or later.
- skalibs version
-2.9.3.0 or later. It's a build-time requirement. It's also a run-time
+2.9.4.0 or later. It's a build-time requirement. It's also a run-time
requirement if you link against the shared version of the skalibs
library.
@@ -66,7 +66,7 @@ library.
Download
- - The current released version of execline is 2.6.1.1.
+ - The current released version of execline is 2.7.0.0.
- Alternatively, you can checkout a copy of the
execline
git repository:
diff --git a/doc/trap.html b/doc/trap.html
index 03d5bc4..fafd5c7 100644
--- a/doc/trap.html
+++ b/doc/trap.html
@@ -28,12 +28,12 @@ to the signals it catches.
- trap [ -x ] [ -t millisecs ]
+ trap [ -x ]
{
- [ timeout { progtimeout... } ]
[ SIGTERM { progsigterm... } ]
[ quit { progsigquit... } ]
[ 1 { progsighup... } ]
+ [ default { progdefault... } ]
...
}
prog...
@@ -50,12 +50,12 @@ name (case-insensitive, with or without the SIG prefix),
run when the specified event occurs.
- trap sets traps for the various directives it reads.
A trap for SIGTERM will be triggered when the trap
-program receives a SIGTERM.
-A trap for timeout will be triggered when millisecs
-milliseconds elapse without a signal being caught.
+program receives a SIGTERM. A default
+trap will be used for any signal that is not caught by another trap.
- It spawns a child executing prog....
- It sets the ! environment
-variable to the pid of the prog... process.
+variable to the pid of the prog... process, and the SIGNAL
+environment variable to the trapped signal.
- Whenever it catches a signal, it spawns the program described in the
corresponding directive. It will not spawn a program for the same signal
twice: if the first subprocess is still active when another instance of the
@@ -75,12 +75,8 @@ SIGTERM, unless caught by a SIGTERM directive, will kill the
trap process (and leave prog running). With the
-x option, without a SIGTERM directive, a SIGTERM
will be still be caught by trap, that will send it to
-prog.
- - -t millisecs : if a timeout
-directive exists, the corresponding progtimeout... will be run
-every time millisecs milliseconds elapse without trap
-receiving a signal. By default, millisecs is 0, which means
-infinite (i.e. a timeout directive will never trigger).
+prog. Note that if a default directive is present,
+this option does nothing.
Notes
@@ -88,7 +84,10 @@ infinite (i.e. a timeout directive will never trigger).
- Programs defined in command line directives can start with
importas ! ! to retrieve the pid of
-prog in ${!}
+prog in $!. If they need the signal number, which
+can be the case in default directives, they can for instance use
+multisubstitute { importas ! ! importas SIGNAL SIGNAL }
+to get both $! and $SIGNAL substitutions.
- trap is a standard shell builtin, with similar
functionality. It is more idiomatic, and probably more efficient,
to use that builtin in shell scripts, and to only use the
diff --git a/doc/upgrade.html b/doc/upgrade.html
index fd6e41b..aa23ab2 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,6 +18,16 @@
What has changed in execline
+ in 2.7.0.0
+
+
+ - skalibs
+dependency bumped to 2.9.4.0.
+ - New -e option to forstdin.
+ - New default directive to trap,
+replacing the timeout one, which was ill-suited to that program.
+
+
in 2.6.1.1