tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Help with function to check if Bash version >= 2

useradd script ▻

Remove lines from stdin

In article <5608FBFE6CFB26BC.6E57DF26BBD619D8.253A84F3D8BCE2B2@lp.airnews.net>,
 <shmartonak@ticnet.com> wrote:
>Not sure if it's in all unices, but GNU has the utility 'tac' which
>reverses a file.  Using 'tac', the original problem can be done with
>
>tac | sed 1,$1d | tac

Beware that the second `tac' will write its input to a temporary file.
(So will the first, if its input is not a seekable file.)  This fact
does not appear to be documented!

And, no, `tac' is very far from universal.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Remove lines from stdin
Date: 21 Jan 2000 13:32:15 -0000
Message-ID: <869n5l$ma0$1@ltpcg.star.le.ac.uk>
References: <slrn887kft.p8.ken@pulsar.halcyon.com>
  <860t2h$j0n$1@hubble.csuchico.edu> <slrn8882n0.i5.ken@pulsar.halcyon.com>
  <5608FBFE6CFB26BC.6E57DF26BBD619D8.253A84F3D8BCE2B2@lp.airnews.net>

△ comp.unix.shell △

◅ Help with function to check if Bash version >= 2

useradd script ▻