[Top][All Lists]

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

Re: find printing full paths

From: Bob Proulx
Subject: Re: find printing full paths
Date: Thu, 15 Jun 2006 22:24:58 -0600
User-agent: Mutt/1.5.9i

The Wanderer wrote:
> What I was doing at the time, so far as I remember, was:
> for i in `ls path/to/directory1/ path/to/directory2/` ; do ls -l $i && 
> <complex operation I don't care to reproduce here> $i ; done
> but that didn't work because the filename printed by the subshell did
> not exist in the present directory.

Would this have worked there?  I think it is basically the same
thing.  But avoids the extra ls process and uses the shell directly
to list the directory.

  for i in path/to/directory1/* path/to/directory2/* ; do
    ls -l $i && <complex operation> $i

> If I were attempting to find in the hierarchy beginning at the curent
> directory, that would be fine. However, it is far more common for me to
> want to find in some hierarchy other than the one I'm currently at the
> top of,

How about this?

  find $PWD/foo/* $PWD/bar/*


  find $PWD/{foo,bar}/*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]