[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using tail in a pipe and script



Lance Hoffmeyer <lance@augustmail.com> writes:
LH> I am trying to write a script and I need to remove the top 3 lines of a
LH> file.  I thought tail would be the tool for the job.
LH> 
LH> The script is:
LH> 
LH> enscript -1 -r -M Letter -p outputfile $1
LH> 
LH> I need tail to take off the top 3 lines of $1

Probably

  tail +3 $1 | enscript -1r -M Letter -p outputfile

Or, failing that:

  tail +3 $1 > tmpfile
  enscript -1r -M Letter -p outputfile tmpfile

Often, programs will accept '-' as a command-line parameter in place
of a file name to mean "standard input".

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: