bug-coreutils
[Top][All Lists]
Advanced

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

Re: filutils 4.1


From: James Youngman
Subject: Re: filutils 4.1
Date: Thu, 15 Jun 2006 15:43:47 +0100

On 6/15/06, The Wanderer <address@hidden> wrote:
For the little it's worth, I also find myself wanting to do something
like this from time to time, usually in a context in which find is not a
satisfactory alternative - or, at best, in which it would be awkward and
potentially difficult to construct a find command which would match all
of the desired files and no others. (For that matter, I've just scoured
the man page to find, and I do not see an option to make it print the
absolute path to the file rather than the path relative to the directory
from which find was invoked.)

For the record, suppose the list of things you wish to search is in
the shell variable dirlist.   You can then do it like this:

$ dirlist="foo bar baz"
$ find $( for dir in $dirlist; do ( cd $dir && pwd ) ; done )    -print
/tmp/foo
/tmp/foo/29452
/tmp/foo/10849
/tmp/foo/7165
/tmp/bar
/tmp/bar/19148
/tmp/bar/2729
/tmp/bar/32714
/tmp/baz
/tmp/baz/25967
/tmp/baz/13157
/tmp/baz/30767




reply via email to

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