[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
multi-line commands in the history get split when bash is quit
From: |
Slevin McGuigan |
Subject: |
multi-line commands in the history get split when bash is quit |
Date: |
Sat, 05 Feb 2011 22:56:36 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
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...)
- multi-line commands in the history get split when bash is quit,
Slevin McGuigan <=
- Re: multi-line commands in the history get split when bash is quit, Bob Proulx, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Michael Witten, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Jon Seymour, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Michael Witten, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Chris F.A. Johnson, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Michael Witten, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Michael Witten, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Jon Seymour, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Michael Witten, 2011/02/05
- Re: multi-line commands in the history get split when bash is quit, Jon Seymour, 2011/02/05