Re:Unix Shell Programming: The Next 50 Years [pdf]
by bccdee on Friday June 04, 2021 @12:19PM
(#27395192)
I have `alias rm="echo DISABLED"` in my shell rc, and I have `trash` defined as a big shell function that safely moves stuff to the x desktop trash bin without clobbering anything. It's mildly irritating, but it gives me incredible peace of mind.
Re:Unix Shell Programming: The Next 50 Years [pdf]
by teddyh on Friday June 04, 2021 @11:15AM
(#27394418)
> in zsh […] setopt NO_CLOBBER
In Bash it’s
set -o noclobber
or set -C
Re:Unix Shell Programming: The Next 50 Years [pdf]
by gnubison on Saturday June 05, 2021 @11:45PM
(#27410611)
Those work in any POSIX shell, and also zsh.
Re:Unix Shell Programming: The Next 50 Years [pdf]
by teddyh on Monday June 07, 2021 @07:54AM
(#27421473)
It seems you are correct:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...
At least in zsh, you can prevent such mistakes by
It's saved my bacon many times.Also, from bitter experience I've forced myself to get in to the habit of never typing:
but instead always doing: It forces me to be more conscious of what I'm deleting.