On 2011-12-06 17:33:02 +0200, Petru Ratiu wrote:
> 2011/12/6 Camelia Nastase <[email protected]>:
> >>
> >
> > ls -1 | grep "*.C" | grep -v PWG4 | xargs <blabla>
> >
>
>
> Te-ai grabit, grep vrea regexp :)
>
> ls |grep '\.C$' | grep -v PWG4 | xargs rm
>
> Da' daca sunt fisiere cu spatii si alte prostii prin nume, xargs se
> sperie, e mai sanatos cu find:
>
> find . -maxdepth 1 -name '*.C' -a ! -name '*PWG4*' -delete
hai ca stii si despre print0 :P
find ... -print0 | xargs -0
ie:
find . -maxdepth 1 ! -name \*PWG4\*.C -type f -print0 | xargs -0 rm -f
si pentru OP, scula e "find", n-are rost s-o ocolesti ;)
--
perl -MLWP::Simple -e'print$_[rand(split(q.%%\n.,
get(q{http://cpan.org/misc/japh})))]'
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug