HP3000-L Archives

November 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Korb <[log in to unmask]>
Reply To:
John Korb <[log in to unmask]>
Date:
Fri, 20 Nov 1998 08:45:47 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Another dumb question from a POSIX dummy (me).

I'm trying to do a "grep" on all files in a particular directory and all
its subdirectories and I'm running into some problems.  Perhaps one of the
POSIX gurus knows a solution.  Here is what I have tried (and what I've
learned):

o  Since "grep" only allows a file or directory (but no recursive
   directories), I figured I'd use "ls" to generate a list of files in
   the directory and its subdirectories, then use "xargs" to turn the
   file names into targets for "grep".

o  I know that in the CI I can use:

      listfile /COMM/DOC/html/,6

   to get a list of all files in the directory and all files in its
   subdirectories, but this is an MPE solution and I'm trying to use
   POSIX.

o  I know that "ls -Rx1 /COMM/DOC/html" will generate a list of files
   in the directory and its subdirectories, but it doesn't produce a
   list of "fully-qualified" file names.  Instead, it lists the directory
   name and then lists the files in that directory, then a blank line,
   then the next directory name, then the list of files in that directory,
   etc.  This is not suitable for "xargs" and "grep".

Okay, what am I overlooking?  How can I get "ls" to give me the kind of
file listing that the "listfile,6" command (above) gives me (or is there a
different command I should be using)?

Thanks!

John
--------------------------------------------------------------
John Korb                            email: [log in to unmask]
Innovative Software Solutions, Inc.

The thoughts, comments, and opinions expressed herein are mine
and do not reflect those of my employer(s), or anyone else.

ATOM RSS1 RSS2