|
|
A shell script to empty the trash on a single volume
This script is bad. It deletes all the trashes for all users on that disk, which, unless you are the ONLY user on the machine, is not good. This also uses 'sudo' which should only be used if you are trying to delete a difficult file. Also this cannot delete the trash in the root volume, as it is not mounted in /Volumes. A revision that sorrects all but that last point follows:
#!/bin/sh---
A shell script to empty the trash on a single volume
Anybody copying this script should check and double check that there is no space before the "*" on the rm line. If a space is inadvertently put there the script will remove all your files on that volume.
Danger will robinson
this script is still dangerous.
Danger will robinson
Your first concer is resolved by the absolute path in the 'rm' command, and your second is resolved by the "Quotes" around the path. ;)
Danger will robinson
From your suggestion, I make this: |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.12 seconds |
|