Author Topic: rm: cannot lstat error when using grep  (Read 1564 times)

dynaweb

  • <b>Canine Deamon</b>
  • Administrator
  • Sr. Member
  • *****
  • Posts: 483
  • Karma: +10/-0
  • Generic personal text here ...
    • MSN Messenger - danno_d_manno@yahoo.com
    • View Profile
    • DynaWeb Designs
    • Email
rm: cannot lstat error when using grep
« on: December 19, 2005, 12:35:24 PM »
I am trying to search my email queue for unwanted messages that contain a common text content then delete those email files. To achieve this I am using "grep" combined with "find". The common text is "X-Mailer: popper" and the directory is /var/spool, so the command I used was
Code: [Select]
rm -i $(grep -r -i \'X-Mailer: popper\' /var/spool)


It finds the files ok, but for each file it returns an error message...[indent]rm: cannot lstat `/var/spool/exim/input/s/1Em6Cs-0000Vk-DP-D:X-Mailer:\': No such file or directory

rm: cannot lstat `popper\': No such file or directory
rm: cannot lstat `/var/spool/exim/input/0/1Em540-0003PZ-Ur-D:X-Mailer:\': No such file or directory
rm: cannot lstat `popper\': No such file or directory
 

[/indent]..and so on for each occurance. Any idea what I am doing wrong here?
Those who cannot learn from history are doomed to repeat it. -- Linux learns.

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1456 Views
Last post August 16, 2005, 02:25:42 PM
by adb22791
5 Replies
1974 Views
Last post November 23, 2005, 12:39:57 PM
by dynaweb
1 Replies
1435 Views
Last post January 15, 2006, 01:42:32 AM
by dynaweb
1 Replies
1344 Views
Last post June 05, 2006, 03:01:39 PM
by dynaweb
1 Replies
1064 Views
Last post August 28, 2006, 03:02:54 PM
by ctwjr