On Thu, 1 Jan 2015 19:04:37 -0500
Shawn H Corey wrote:
> On Thu, 1 Jan 2015 15:11:36 -0800
> SSC_perl wrote:
>
> > Thanks, guys. I appreciate the responses. I couldn't get
> > either of those solutions to work so I'll switch over to using
> > File::Find. I don't know why I didn't think o
On Jan 1, 2015, at 4:08 PM, $Bill wrote:
> You can always separate the two, eg:
>
> my $find = "find $dir_to_search" .
> '-name cache -prune' .
> '-o -name tmp -prune' .
> '-o -name session -prune' .
> '-o -print';
>
>
On Thu, 1 Jan 2015 15:11:36 -0800
SSC_perl wrote:
> Thanks, guys. I appreciate the responses. I couldn't get
> either of those solutions to work so I'll switch over to using
> File::Find. I don't know why I didn't think of that before - I use
> it in other scripts. :\ I guess I was just
Thanks, guys. I appreciate the responses. I couldn't get either of
those solutions to work so I'll switch over to using File::Find. I don't know
why I didn't think of that before - I use it in other scripts. :\ I guess I
was just trying to see if I could tweak the script and get it t
Hi Frank
There are two different approaches I can see to this.
1) Use this instead https://metacpan.org/pod/File::Find
2) Replace the `find ...` with this comma separated sequence of commands
$cmd = "
find $dir_to_search
-name cache
-prune -o
Mornin' --
By using back-ticks, you are running the find command in a sub-shell. The
usual Shell continuation conventions apply. You have to escape the
new-line:
`find $dir_to_search
-name cache -prune \
-o -name tmp -prune \
Is it possible to wrap a `find` command on multiple lines in a script?
This is what I'm using now:
foreach $dir_to_search (@dirs_to_search) {
$dir_count--;
@files = map {
s|/home/user/public_html ||;
$_;
} `find $dir_to_search -na