kevictor83 has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I'm having trouble implementing the following non-recursive find in perl-
find ./files_36/ \( ! -name files_36 -prune \) -name "*fiPL.csv*" -printThe above works from the command line. The following code below in Perl doesnt work though.
my $patt = "*".$_."*"; my $lc_file1 = ""; my $cmd = "find $dir1 \(! -name /proj/dev_dbdump/files_36 -prune\) -n +ame $patt -print"; $lc_file1 = `$cmd`;
I've tried doing a few things, such as removing the escape characters, but all i get is the following compile error!- sh: syntax error at line 1: `(' unexpected I would appreciate any advise!!! NOTE: Due to the nature of the input I'm getting, I'd rather use unix find, as opposed to reg ex.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Backtick Query
by chrestomanci (Priest) on Mar 06, 2011 at 10:35 UTC | |
|
Re: Backtick Query
by roboticus (Chancellor) on Mar 06, 2011 at 16:20 UTC | |
|
Re: Backtick Query
by toolic (Bishop) on Mar 06, 2011 at 13:37 UTC |