3 ms·
That actually runs the commands right? How do you deal with commands that perform some action that maybe couldn't be reverted easily?
by chockchocschoir 5y ago
That actually runs the commands right? How do you deal with commands that perform some action that maybe couldn't be reverted easily?
- tedmiston 5y agoCorrect. If I don't necessarily want to run all of the commands, I make a "do-nothing script" [1][2] that just echoes them out instead. I don't have a generalized example of undo / redo in bash commands, since I don't believe it's possible, but for example, if I'm running a destructive command, I prefer to run the dry run version first, then have a confirmation prompt [3] before running the destructive action. [1]: https://news.ycombinator.com/item?id=20495739 https://news.ycombinator.com/item?id=20495739 [2]: https://news.ycombinator.com/item?id=29083367 https://news.ycombinator.com/item?id=29083367 [3]: https://stackoverflow.com/q/1885525/149428 https://stackoverflow.com/q/1885525/149428