Let’s say I execute the following command in either BASH or Kornshell:
$ foo | while read line
> do
> echo "Line = '$line'"
> done
If I have vi set, and edit it in Kornshell, I get:
foo | while read line
do
echo "Line = '$line'"
done
If I have vi set, and edit it in BASH, I get:
foo | while read line;do; echo "Line = '$line'";done
Is there a way I can get command line editing in BASH the same way Kornshell works?
You need to enable the
lithist(literal history) option which tells bash to retain the newlines: