On Tue, 10 Oct 2000 11:49:43 +0300 Meir Faraj <[EMAIL PROTECTED]>
writes:
> Hi ,
> I've tryed this :
> [root@localhost myscripts]#  find .. -name "*.class" | rm
> rm: too few arguments
> Try `rm --help' for more information.


rm doesn't take input from stdin.  Things like ls, rm, cp and several
others don't read stdin.

you can try:
        find .. -name \*.class -exec rm {} \;

Escaping the splat will prevent the shell from interperting it, thus
passing it to find(1).
find plus a regex is _very_ powerful.  It can also produce some
unexpected results too so be careful when coupling it w/ -exec

See the killer ORA owl book ("Mastering Regualr Expressions", I think)
for more strange and wonderful things you can do with regex's.  He's got
a one page regex for parsing mail headers.  It's truly a work of art -
looks like a bunch of line noise.


> 
> 
> when :
> 
> [root@localhost myscripts]#  find .. -name "*.class"
> ../client/core/org/NoNextComponentException.class
> ../client/core/org/NoPartSelectedException.class
> ../client/core/org/PartNotFoundException.class
> ../client/core/org/XMLFactory.class
> ../client/core/org/XMLGui.class
> ../client/core/shell/component/XMLComponent.class
> ../client/core/shell/container/XMLPanel.class
> ../client/core/shell/main/NetSharer$1.class
> ../client/core/shell/main/NetSharer.class
> ../client/core/utils/codecs/Base64.class  
> 
> so rm doesn't see the pipe ;-)
> 

-----BEGIN GEEK CODE BLOCK-----
Version 3.12  (see http://www.geekcode.com/geek.html for details)
GCS d- s: a C++$ ULAHS++++$ P+++$ L+++>++++$ E++>++++ W+(-) N+ o K? w---
O- !M-- V- PS+ PE+ Y+ PGP t 5- X- R- tv-->! b++ DI++ D+ G+ e++>++++ h*
r++ y++++
------END GEEK CODE BLOCK------

Reply via email to