Hi,
I am unsure whether or not this a bug. Anyhow, it is pretty annoying...
I use simple multi-line scripts very often in bash and use vi mode to
edit them. By using
# shopt -s cmdhist
# shopt -s lithist
I can achive multi-line editing. Which is fine.
But this ability "breaks" as soon as I close bash and open it again.
Is this a bug?
Are there suggestions for workarounds?
Thanks and with best regards,
Slevin
----- ----- -----
DETAILS / HOW TO REPRODUCE
the bash I use
# bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation, Inc.
an example multiline script
# for i in 1 2
> do
> echo $i
> done
1
2
let's look into the history. Looks good, command #409 is my multiline script
# history | tail -n 10
echo $i
done
406 history | tail -n 5
407 history | tail -n 10
408 bash --version
409 for i in 1 2
do
echo $i
done
410 history | tail -n 10
I can easily repeat #409. I can also go back in the history and vi the
whole script
# !409
for i in 1 2
do
echo $i
done
1
2
Exit the shell and start it again
# exit
Look at the history again
# history | tail -n 10
417 history | tail -n 10
418 for i in 1 2
419 do
420 echo $i
421 done
422 exit
423 exit
424 history -n 10
425 history | tail -n 15
426 history | tail -n 10
Shit. The multiline script has been saved as more then one command
Re-executing the script or vi'ing the script ain't possible...
# !418
for i in 1 2
>
>
>
> (bash is waiting for further input...)