| ▲ | IgorPartola 13 hours ago | |||||||||||||||||||||||||||||||
I wouldn’t want most things to work this way:
There is a time and a place for it but it should not be the majority of use cases. | ||||||||||||||||||||||||||||||||
| ▲ | Darfk 13 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
Totally agree it shouldn't be for basic tools; but if I'm ever developing a script that performs any kind of logic before reaching out to a DB or vendor API and modifies 100k user records, creating a flag to just verify the sanity of the logic is a necessity. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | digiown 12 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
For most of these local data manipulation type of commands, I'd rather just have them behave dangerously, and rely on filesystems snapshots to rollback when needed. With modern filesystems like zfs or btrfs, you can take a full snapshot every minute and keep it for a while to negate the damage done by almost all of these scripts. They double as a backup solution too. | ||||||||||||||||||||||||||||||||
| ▲ | ronjakoi 10 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
I used to have alias rm='rm -i' for a few years to be careful, but I took it out once I realised that I had just begun adding -f all the time | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | hdjrudni 13 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Even in those basic examples, it probably would be useful. `cp` to a blank file? No problem. `cp` over an existing file? Yeah, I want to be warned. `rm` a single file? Fine. `rm /`? Maybe block that one. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | Mawr 14 minutes ago | parent | prev [-] | |||||||||||||||||||||||||||||||
Uhuh: | ||||||||||||||||||||||||||||||||