0

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.

2
  • 1
    lithist option? Commented Apr 17, 2023 at 14:47
  • @StéphaneChazelas that looks a lot like the answer; as it turns out, the systems where it works as in the second case use ksh, where this is the normal behaviour. Thx! Commented Apr 17, 2023 at 14:56

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.