Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Reason for Find invalid switch error

by rrrrr (Novice)
on Sep 18, 2012 at 07:10 UTC ( #994208=perlquestion: print w/ replies, xml ) Need Help??
rrrrr has asked for the wisdom of the Perl Monks concerning the following question:

I need reason for Find Invalid switch error for the below code

#!/usr/bin/perl print("find /D/ARCHIVE/BIOS/PRTFILES -mtime +1 -exec rm -rf {} \\"); system("find /D/ARCHIVE/BIOS/PRTFILES -mtime +1 -exec rm -rf {} \\");

Replies are listed 'Best First'.
Re: Reason for Find invalid switch error
by choroba (Chancellor) on Sep 18, 2012 at 07:12 UTC
    Where is a semicolon? -exec should end in a semicolon.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Reason for Find invalid switch error
by Anonymous Monk on Sep 18, 2012 at 07:17 UTC

    Do you see output after END?

    print "find /D/ARCHIVE/BIOS/PRTFILES -mtime +1 -exec rm -rf {} \\" __END__ find /D/ARCHIVE/BIOS/PRTFILES -mtime +1 -exec rm -rf {} \

    Is that valid linux command?

    I don't linux, but it doesn't look particularly valid to me

    Figure out how to work the linux command from linux shell, and then wrap it up in perl script

    Once you have a working command, for example, saved as myshellscript.sh you can use

     perl -MData::Dump -MIO::All -e " dd map { io($_)->all } @ARGV " myshellscript.sh  > myperlscript.pl

    to quote it properly for to give to system

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://994208]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2016-06-28 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (359 votes). Check out past polls.