News for hackers. Stuff that matters.
Re:Ooops. by sambeau on Thursday June 16, 2011 @02:31PM (#2662564)
Unix could really do with a command that you can wrap around this type of call. Either a sanity check on the path part or a safe rm alternative that contains it. I would gladly give up full rm access to know that I can safely (or safer-ly) delete in scripts.

It could be something as simple as a file with paths on each line it - match one path or a path with a glob - and the script fails before destroying anything important.

Overriding it might involve adding a --override=/path/to/something but at least then it would be very explicit

Re:Ooops. by adsr on Thursday June 16, 2011 @02:58PM (#2662690)
I sometimes use a wrapper around mv that moves the folder to trash. Guess it's not that portable but it could be replaced by moving to /tmp or something instead perhaps.
Re:Ooops. by sambeau on Thursday June 16, 2011 @02:34PM (#2662580)
Ah. It seems I have just described 'safe-rm'.

Great minds etc :)

Re:Ooops. by fmarier on Thursday June 16, 2011 @05:29PM (#2663358)
Indeed. Those were exactly the design goals I had when I wrote safe-rm (shortly after deleting my /usr/lib!).