~/.Trash rule not working?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

~/.Trash rule not working? Mon Jul 19, 2010 1:25 pm • by brijazz
I have a rule set up to monitor my ~/.Trash folder, but it doesn't seem to be working properly. The intent of the rule is to securely delete any .torrent files that hit the trash. Here's how it's set up:

1) If any extension contains torrent
2) Run the following shell script. The shell is /bin/sh and the script is "srm $1" (without the quotes of course)

When I do a "preview rule matches", it properly identifies the .torrent files, but when I run the rule, it doesn't delete anything. Any suggestions?
brijazz
 
Posts: 21
Joined: Sun Mar 08, 2009 9:07 am

Re: ~/.Trash rule not working? Mon Jul 26, 2010 1:48 pm • by Mr_Noodle
Did you email me about this? In case you're someone else, I'll post the answer here: put double quotes around the $1 (you should do this in general if writing bash scripts). If the file path contains any spaces, putting quotes around it ("$1") will handle that.
Mr_Noodle
Site Admin
 
Posts: 11270
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support