Re: catting contents of a file and seeing the file names

From: Sean-Paul Rees (sean@dreamfire.net)
Date: Mon Aug 02 1999 - 10:38:05 PDT


"Brian E. Lavender" wrote:
>
> sometimes I want to look at the contents of numerous text files. If I do
> $ cat *.txt | less
> it will cat all the files in that directory, but I don't know exactly
> which file I am looking at. Is there a way to cat a series of files and
> have it so you see the file name at the beginning of each file shown?

more *.txt i think does it

or, if that don't work:

#!/bin/sh
for i in `ls *.txt`
do
  echo [Heyo, this is: $i]
  less $i
  echo [Ok, $i is finished]
done



This archive was generated by hypermail 2b29 : Fri Feb 11 2000 - 16:20:19 PST