kevictor83:

First, I'd suggest you use File::Find instead of invoking find through the shell. Next, there's a nice tool that comes with File::Find that will translate the find command into the equivalent perl code, which you can then modify to do what you like, like so:

$ find2perl ./bin \( ! -name files_36 -prune \) -name "*fiPL.csv*" -pr +int #! /usr/bin/perl -w eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; sub wanted; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, './bin'); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); ( (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && ! /^files_36\z/s && ($File::Find::prune = 1) ) && /^.*fiPL\.csv.*\z/s && print("$name\n"); }

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re: Backtick Query by roboticus
in thread Backtick Query by kevictor83

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.