[prog] Perl and find(1)

Mary Gardiner mary-linuxchix at puzzling.org
Mon Dec 11 05:38:59 UTC 2006


On Mon, Dec 11, 2006, Mary Gardiner wrote:
> On Mon, Dec 11, 2006, Jacinta Richardson wrote:
> > I can't even get the find command to work outside of Perl:
> > 
> > jarich at bella:/tmp$ find . -atime +14 -name "*.tgz" -print -exec "ls -al"
> > find: missing argument to `-exec'
> 
> -exec arguments must be terminated with a semi-colon, which usually
> needs to be escaped with "\;", so:
> 
> find . -atime +14 -name "*.tgz" -print -exec "ls -al" \;

Kathryn's find command is even more correct than this (you need {} as
well...)

-Mary


More information about the Programming mailing list