Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ Simple script

Posted by: dom9360 Jul 14 2008, 11:17 AM

What am I doing wrong here?

Just trying to locate all files named Spam and make them blank (not deleting them).


find /home/virtual -type f -name "Spam" -exec echo $blank > {} \;

Posted by: dom9360 Jul 15 2008, 08:54 AM

Any one???

Posted by: michaelk Jul 15 2008, 08:59 PM

What are you trying to accomplish?

Posted by: dom9360 Jul 16 2008, 01:50 PM

QUOTE (michaelk @ Jul 15 2008, 08:59 PM) *
What are you trying to accomplish?


Try to search for files called 'Spam'.

Next, nullify the file.

This is a spam file on people's email boxes. They don't empty them out. However, they periodically need to check it just in case something good goes over there.

Thanks,D

Posted by: markjr Jul 17 2008, 12:35 PM

QUOTE (dom9360 @ Jul 16 2008, 01:50 PM) *
Try to search for files called 'Spam'.

Next, nullify the file.

This is a spam file on people's email boxes. They don't empty them out. However, they periodically need to check it just in case something good goes over there.

Thanks,D



I would just cp /dev/null onto them. You probably need to use -f

CODE
find /home/virtual -type f -name "Spam" -exec "cp -f /dev/null {}" \;

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)