public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/devmanual:master commit in: tools-reference/head-and-tail/
@ 2020-01-09 19:08 Ulrich Müller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2020-01-09 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     e1ef5183c2e4b79103b9edea6eda20f1054a4fe5
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  8 09:23:27 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jan  9 08:31:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e1ef5183

tools-reference/head-and-tail: Line counting in tail starts at 1.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 tools-reference/head-and-tail/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools-reference/head-and-tail/text.xml b/tools-reference/head-and-tail/text.xml
index 07ebd28..e2b7553 100644
--- a/tools-reference/head-and-tail/text.xml
+++ b/tools-reference/head-and-tail/text.xml
@@ -33,7 +33,7 @@ file. The <c>-n</c> argument specifies how many lines to display.
 
 <p>
 To specify "the last five lines", use <c>tail -n5</c>. To specify "all
-but the first five lines", use <c>tail -n+5</c>.
+but the first five lines", use <c>tail -n+6</c>.
 </p>
 
 <warning>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: tools-reference/head-and-tail/
@ 2020-01-09 19:08 Ulrich Müller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2020-01-09 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     c2e9f75dbf89db8e19615dc0b15b05f4d5698584
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  8 09:24:41 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jan  9 08:31:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=c2e9f75d

tools-reference/head-and-tail: Add another example for tail.

The bad example is taken from the script referenced in bug 536654.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 tools-reference/head-and-tail/text.xml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools-reference/head-and-tail/text.xml b/tools-reference/head-and-tail/text.xml
index e2b7553..06f17de 100644
--- a/tools-reference/head-and-tail/text.xml
+++ b/tools-reference/head-and-tail/text.xml
@@ -36,6 +36,14 @@ To specify "the last five lines", use <c>tail -n5</c>. To specify "all
 but the first five lines", use <c>tail -n+6</c>.
 </p>
 
+<codesample lang="ebuild">
+# bad: drop first five lines, clumsily computing line count
+tail -n $(($(wc -l in.txt | awk '{print $1}') - 5)) in.txt &gt; out.txt
+
+# good: let tail count lines from the beginning of the file
+tail -n +6 in.txt &gt; out.txt
+</codesample>
+
 <warning>
 <c>head/tail -5</c> syntax is deprecated and not POSIX compliant.
 </warning>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: tools-reference/head-and-tail/
@ 2020-01-09 19:08 Ulrich Müller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2020-01-09 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     2a47d037f690f575c28a5fa4863c1483a8ddd46b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  8 09:33:55 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jan  9 08:31:56 2020 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=2a47d037

tools-reference/head-and-tail: Fix highlighting in title.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 tools-reference/head-and-tail/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools-reference/head-and-tail/text.xml b/tools-reference/head-and-tail/text.xml
index 06f17de..44f0264 100644
--- a/tools-reference/head-and-tail/text.xml
+++ b/tools-reference/head-and-tail/text.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <guide self="tools-reference/head-and-tail/">
 <chapter>
-<title><c>head-and-tail</c> -- Line Extraction</title>
+<title><c>head</c> and <c>tail</c> -- Line Extraction</title>
 <body>
 
 <p>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: tools-reference/head-and-tail/
@ 2020-02-23 20:27 Ulrich Müller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2020-02-23 20:27 UTC (permalink / raw
  To: gentoo-commits

commit:     281633482a0a3cdb26bae7c7b50f9fbb16673fb0
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 23 20:27:05 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 23 20:27:05 2020 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=28163348

tools-reference/head-and-tail: Fix typo.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 tools-reference/head-and-tail/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools-reference/head-and-tail/text.xml b/tools-reference/head-and-tail/text.xml
index d422065..da7d121 100644
--- a/tools-reference/head-and-tail/text.xml
+++ b/tools-reference/head-and-tail/text.xml
@@ -58,7 +58,7 @@ many non-portable options.
 </body>
 
 <section>
-<title>Chaining with <c>head</c> or <c>tail</c> with <c>sed</c></title>
+<title>Chaining <c>head</c> or <c>tail</c> with <c>sed</c></title>
 <body>
 <p>
 Chaining <c>head</c> or <c>tail</c> with <c>sed</c> is usually


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-23 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-09 19:08 [gentoo-commits] proj/devmanual:master commit in: tools-reference/head-and-tail/ Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2020-02-23 20:27 Ulrich Müller
2020-01-09 19:08 Ulrich Müller
2020-01-09 19:08 Ulrich Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox