Reputation: 4691
I have a command in the form:
find -name *.* -type f -exec rm {} -v \;
And I want to get the list of files that it processed into a variable. How would I do that in ksh?
Upvotes: 1
Views: 2665
Reputation: 36229
I'm not a ksh-user, so I might be wrong. In bash, I have to mask the asteriks:
find -name "*.*" -type f -exec rm {} -v \;
and I can use -delete instead of -exec rm, but delete is special for GNU-find:
find -name "*.*" -type f -delete
and to output the file names, append a print:
find -name "*.*" -type f -delete -print
and capture the output
deleted=$(find -name "*.*" -type f -delete -print)
Upvotes: 0