For moving all files in sub folders into the current folder I use this script
while read f
do
mv "$f" .
done < file_list
this works great but i have to generate the file_list
with
find . -name *.avi > file_list
what i want is to add the command directly to my while loop
while read f
do
mv "$f" .
done < find . -name *.avi
but bash tells me -bash: syntax error near unexpected token `.'
What is an easy solution to pipe the find command into my while loop?
-exec
option offind
to have a sound way of doing what you want. Are you open to that?