>>>You can also use a bash for loop:
>>>
>>>for myfile in *.txt ; do rm "$myfile" ; done
>>>      
>>>
>>or:
>>
>>find *.txt | while read f; do rm "$f" ; done
>>
>>That avoids the problem of the commandline being too long (shell
>>expansion will sometimes cause your command to fail if there are too
>>many files.
>>    
>>
>
>If you want to avoid expansion, you should have said:
>
>find -name '*.txt' | while read f; do rm "$f" ; done
>
>Bash and its pesky quoting rules...
>  
>
The quotes are *absolutely* necessary, if not:
/usr/bin/find: Argument list too long

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to