Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.shell > #21474

Re: finding directories based on files within?

From Eli the Bearded <*@eli.users.panix.com>
Newsgroups comp.unix.shell
Subject Re: finding directories based on files within?
Date 2021-05-13 17:11 +0000
Organization Some absurd concept
Message-ID <eli$2105131311@qaz.wtf> (permalink)
References <eli$2105101745@qaz.wtf> <86zgwy66yu.fsf@red.stonehenge.com>

Show all headers | View raw


In comp.unix.shell, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "EtB" == Eli the Bearded <*@eli.users.panix.com> writes:
> EtB> I currently have a simple shell script along the lines of:
> EtB> 	find "$1" -type d \
> EtB> 		-exec test -f {}/SENTINEL-1 \; \
> EtB> 		-exec test -f {}/SENTINEL-2 \; \
> EtB> 		-print
> 
> Eli!  Have you forgotten your Perl?

No, I "use File::Find" for other finding needs.

> find2perl "$1" -type -d \
>   -eval '-f "SENTINEL-1" and -f "SENTINEL-2"' -print | perl

But I have forgotten "find2perl". That looks a lot better for "one"
liners.

> Done.  And if you cache the program, it's just one Perl process. :)

I expect I will do that.

Elijah
------
likes this suggestion

Back to comp.unix.shell | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

finding directories based on files within? Eli the Bearded <*@eli.users.panix.com> - 2021-05-10 22:13 +0000
  Re: finding directories based on files within? Spiros Bousbouras <spibou@gmail.com> - 2021-05-13 02:38 +0000
  Re: finding directories based on files within? Martijn Dekker <martijn@inlv.demon.nl> - 2021-05-13 04:50 +0200
  Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 07:20 -0500
    Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 09:04 -0500
  Re: finding directories based on files within? Axel Reichert <mail@axel-reichert.de> - 2021-05-13 14:56 +0200
    Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 08:44 -0500
      Re: finding directories based on files within? Axel Reichert <mail@axel-reichert.de> - 2021-05-13 21:09 +0200
  Re: finding directories based on files within? merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-13 07:31 -0700
    Re: finding directories based on files within? Eli the Bearded <*@eli.users.panix.com> - 2021-05-13 17:11 +0000
    Re: finding directories based on files within? Christian Weisgerber <naddy@mips.inka.de> - 2021-05-13 22:04 +0000
      Re: finding directories based on files within? merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-15 06:45 -0700
      find2perl (Was: finding directories based on files within?) gazelle@shell.xmission.com (Kenny McCormack) - 2021-05-15 17:32 +0000
        Re: find2perl Dan Espen <dan1espen@gmail.com> - 2021-05-15 13:46 -0400
        Re: find2perl (Was: finding directories based on files within?) Christian Weisgerber <naddy@mips.inka.de> - 2021-05-15 20:17 +0000
          Re: find2perl (Was: finding directories based on files within?) gazelle@shell.xmission.com (Kenny McCormack) - 2021-05-16 13:06 +0000
        Re: find2perl merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-15 15:34 -0700

csiph-web