Re:An UPDATE without a WHERE, or something close to it
by bombcar on Friday October 29, 2021 @09:42AM
(#29038276)
I've taken to using "echo" and then when I run the command run it with a space at the front - you may have to run setopt HIST_IGNORE_SPACE or similar to get this in zsh, for example.
That way ctrl+r won't bring back a destructive command.
Re:An UPDATE without a WHERE, or something close to it
by pletnes on Friday October 29, 2021 @10:26AM
(#29038810)
Echoing the command also lets you see that shell escaping, parameter expansion etc. works as you expected. I do the same when writing a one-off loop, too.
That way ctrl+r won't bring back a destructive command.