Help - Search - Members - Calendar
Full Version: Simple script
Linuxhelp > Support > Technical Support
dom9360
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 > {} \;
dom9360
Any one???
michaelk
What are you trying to accomplish?
dom9360
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
markjr
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 {}" \;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.