From 612c2c95c35f9743bbaaf64d0b9856621e7558d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Mon, 8 Mar 2010 08:48:14 +0000 Subject: [PATCH] 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. --- doc/coreutils.texi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index fcee336..3e7a698 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} -- 2.7.4