Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Danger will robinson' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Danger will robinson
Authored by: SOX on Feb 25, '03 11:00:08AM

this script is still dangerous.
if the CD fails the RM takes place in the current directory.

you can make the result conditional like this

( cd somedirectoy ) && ( rm somefile)

also as another poster you do not check to the possibility of spaces in the UID environment variable. In a perfect world there would be none. but the consequences if there are any is that you erase the disk!



[ Reply to This | # ]
Danger will robinson
Authored by: GaelicWizard on Feb 26, '03 03:01:29AM

Your first concer is resolved by the absolute path in the 'rm' command, and your second is resolved by the "Quotes" around the path. ;)

JP

---

Pell



[ Reply to This | # ]
Danger will robinson
Authored by: oink on Nov 05, '03 11:19:46PM

From your suggestion, I make this:

( cd /Volumes/aaa/Trash ; pwd ) && ( rm -friv * ) ;( cd /Volumes/aaa/.Trashes ; pwd ) && ( rm -friv * ) ; ( cd /Trash ; pwd ) && ( rm -friv * ) ; ( cd /.Trashes ; pwd ) && ( rm -friv * ) ; ( cd ~/.Trash ; pwd ) && ( rm -friv * )

the pwd is just to make sure I am in the correct directory and I currently use the -i just to make sure everything is okay.

I am sure it is not the most efficient command, but I switch back and forth between 9 and x and have several drives attached and I seem to have trash cans under all sorts of names on each disk. I am hoping to be able to routinely run such a command (probably an alias) and do what I manually do currently...



[ Reply to This | # ]