Hello,
When I give:
rm -f /usr/local/tomcat/temp_img/\Images\ for\ UAT/0918-721-163-001-4C-P_04.jpg
, the file is being deleted.
I am trying to do the same in a script as follows:
Step 1:
A file named del.txt will have the following (list of files to be deleted):
/usr/local/tomcat/temp_img/\Images\ for\ UAT/0918-721-163-001-4C-P_04.jpg
Step 2: The script
for fname in `cat del.txt`
do
rm -f echo $fname
done
As I pass the line from del.txt in a FOR loop, the fname is set to following:
- /usr/local/tomcat/temp_img/\Images\
- for\
- UAT/0918-721-163-001-4C-P_03.jpg
Hence the file is not being deleted. I tried the rm command within quotes
'rm -f echo $fname'
`rm -f echo $fname`
"rm -f echo $fname"
and also tried to put the test in del.txt within quotes. But no luck. Please help me.
Thanks,
risshanth