From 49b387bb53e76eecd2b6cf4f89f3146fc2198bd3 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Tue, 24 Nov 2020 17:56:57 +0000
Subject: Fix chomping: only make it default on line-processing binaries
---
doc/forbacktickx.html | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
(limited to 'doc/forbacktickx.html')
diff --git a/doc/forbacktickx.html b/doc/forbacktickx.html
index 9cbcd98..d28ad0b 100644
--- a/doc/forbacktickx.html
+++ b/doc/forbacktickx.html
@@ -30,7 +30,7 @@ run another program.
- forbacktickx [ -p | -o okcodes | -x breakcodes ] [ -n ] [ -C | -c ] [ -0 | -d delim ] variable { gen... } loop...
+ forbacktickx [ -p | -o okcodes | -x breakcodes ] [ -N | -n ] [ -C | -c ] [ -0 | -d delim ] variable { gen... } loop...
@@ -54,9 +54,6 @@ output must not contain a null character.
instance to finish before spawning the next one. forbacktickx will
still wait for all instances of loop to terminate before
exiting, though.
- - -0 : accept null characters from gen's output,
-using them as delimiters. If this option and a -d option are
-used simultaneously, the rightmost one wins.
- -o okcodes : okcodes must
be a comma-separated list of exit codes. If the -p flag
hasn't been given and loop exits with one of the codes in
@@ -68,9 +65,32 @@ not listed in okcodes, forbacktickx will exit immediately with an
option, but with inverted meaning - the listed exit codes are codes
that will make forbacktickx break the loop and exit, and the unlisted exit
codes will make it keep looping.
- - Other options are used to control
-the substitution mechanism for every x. Of course, you can't
-split x.
+
+
+
+ Other options are similar (in name and functionality) to the switches
+passed to control a substitution mechanism,
+on purpose; however, forbacktickx does not call the substitution
+mechanism and has its own semantics for those options.
+
+
+
+ - -N : store the whole line in variable,
+including the terminating newline (or other delimiter).
+ - -n : chomp a terminating delimiter from the line from
+stdin before storing it into variable. This is the default.
+ - -C : crunch. If there is an empty line (i.e. that
+only contains a delimiter), do not call loop. If this option is
+given, and chomping is active, and the last line of stdin
+is not terminated by a delimiter, then this last line will not be processed.
+ - -c : do not crunch, call loop even if
+the line is empty. This is the default.
+ - -0 : accept null characters on its stdin,
+using them as delimiters. If this option and a -d option are
+used simultaneously, the rightmost one wins.
+ - -d delim : use the characters in string
+delim as delimiters for a line. Default is "\n", meaning
+the input is only split on newlines.
Notes
--
cgit v1.2.3