I commonly want to do something with a bunch of files, so I type in something like:
$ for nam in *.c
> do
> echo $nam
> done
Aaah, I failed to use upper case C so I go to edit again and since I have
set -o vi
in my .bashrc, I go to edit in vim and it comes up:
for nam in *.c; do echo $nam; done
I deliberately entered newlines in between the commands, I don't want/need bash to improve my text by putting it on a single line. In this case, it is no big deal but if I had several variables and commands, the bash-ification is a pain.
Is there a way to keep bash from reformatting my history?
Asked by user1683793
(423 rep)
Mar 27, 2025, 12:20 AM