This is not a real problem, but something that I'm curious about - and maybe somebody knows the explanation. I work on several servers, mostly Ubuntu 20.04 and 22.04, plus a few Debian 11.
I always work on the command line, and my editing mode is vi. I will often write ad-hoc scripts like:
root@ceres:/etc/pam.d# for i in common*
> do
> echo $i
> grep -vE '^$|^#' $i
> echo
> done
And then, later, I search back to the same command (with Esc-k, of course) and pre v to see the command in vi. On some systems this happens:
root@ceres:/var/lib/icinga# for i in common*; do echo $i; grep -vE '^$|^#' $i; echo ; done
... # press v
for i in common*; do echo $i; grep -vE '^$|^#' $i; echo ; done
~
~
~
but on others, this:
# for i in common*^Jdo^Jecho $i^Jgrep -vE '^$|^#' $i^Jecho^Jdone
... # press v
for i in common*
do
echo $i
grep -vE '^$|^#' $i
echo
done
~
~
~
The question is, why? All my environments are set up the same, as far as I know.
lithistoption?ksh, where this is the normal behaviour. Thx!