summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-03-08 08:48:14 +0000
committerPádraig Brady <P@draigBrady.com>2010-03-09 00:32:07 +0000
commit612c2c95c35f9743bbaaf64d0b9856621e7558d2 (patch)
tree7333271c4f0472c49d759490fe6c4d125cb9c928
parenta7b4fa01ddde3f09eb642cb6378e16522917f8e0 (diff)
downloadcoreutils-612c2c95c35f9743bbaaf64d0b9856621e7558d2.tar.xz
doc: Add an example for cutting fields separated by runs of blanks
* doc/coreutils.texi (cut invocation): Show how tr can be used to process the input for cut in this case. Suggestion from Dan Jacobson.
-rw-r--r--doc/coreutils.texi8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index fcee33618..3e7a69868 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -5318,7 +5318,13 @@ of selected bytes.
Select for printing only the fields listed in @var{field-list}.
Fields are separated by a TAB character by default. Also print any
line that contains no delimiter character, unless the
-@option{--only-delimited} (@option{-s}) option is specified
+@option{--only-delimited} (@option{-s}) option is specified.
+Note @command{cut} does not support specifying runs of whitespace as a
+delimiter, so to achieve that common functionality one can pre-process
+with @command{tr} like:
+@example
+tr -s '[:blank:]' '\t' | cut -f@dots{}
+@end example
@item -d @var{input_delim_byte}
@itemx --delimiter=@var{input_delim_byte}