Changing find to echo

Posted by waszak on Stack Overflow See other posts from Stack Overflow or by waszak
Published on 2011-11-14T01:01:03Z Indexed on 2011/11/14 1:50 UTC
Read the original article Hit count: 126

Filed under:

This is almost good

find  *.txt -print0 | xargs -0 rm -f

And i want to have something like that

echo *.txt ./zad3.sh | xargs -l rm -f

First version is good because I can delete file with white spaces but I can't use my script to select file to delete.

Second version I can select files but I can't delete file with white spaces.

I want to find files with end on .txt and delete some of them. zad3.sh is a script wich is returning file name if i agree to delete it rm catch the name and delete it. It works only for file without white space and special characters. Second version is better but i cant put my script inside it.

find  *.txt -print0| xargs -0 ./zad3.sh |xargs  rm -f

it works almost but i cant pass arg to rm and part of my code

Thx

© Stack Overflow or respective owner

Related posts about bash