need to navigate into specified folder and delete the files

Hi all,

I need to write a script to naviagate into the list of specified folder and delete the files in it.

I have mentioned the list of folders in a external file so it can be reusable.

The issue is am facing now is that, i am not understating on how to navigate into the folder locations specified inside the external file.
For now i am using this mechanisum...

cat /filelist.txt | while read INTLIST
do

  rm -rf *

done

but this is throwing error as

INTLIST:  not found

here filelist.txt has the list of paths to which i have to navigate....

please help....

Thanks,
N

$ awk '{print "rm "$0"/*"}' filelist.txt | sh

hi,

can u plz give me a small detail of the above command...
whr to use it???

do i need to use it instead of rm - rf * or cat /filelist.txt | while read INTLIST???

i am completely new to unix...

$ awk '{print "rm "$0"/*"}' /path/of/filelist.txt | sh 

You can execute this line alone to remove the files inside the specified directories mentioned in filelist.txt .
This awk command will append the "rm" command syntax to your existing filelist.txt file and it passes the content to "sh" to remove it .. For testing purpose, neglect the "sh" and run the code.. If satisfies with the result then add "sh" at the end .. Hope it clears ..

will this run even if i specify 10 to 12 paths in the filelist.txt???

Yes .. It will run ..

Thanks a lot!!!