3 ms·
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
by sambeau 15y ago
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
- sambeau 15y agoAh. It seems I have just described 'safe-rm'. Great minds etc :)
- fmarier 15y agoIndeed. Those were exactly the design goals I had when I wrote safe-rm (shortly after deleting my /usr/lib!).
- adsr 15y agoI 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.