Reputation: 107040
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?
Upvotes: 2
Views: 122
Reputation: 212268
You need two things:
$ shopt -s cmdhist # This is on by default, so probably unnecessary $ shopt -s lithist # This is off by default
Upvotes: 1
Reputation: 120644
You need to enable the lithist
(literal history) option which tells bash to retain the newlines:
$ shopt -s lithist
Upvotes: 5