in reply to Shell style line-editing without benefit of CPAN modules

does your linux install have the bash shell with readline support??
#!/usr/bin/perl open $shell, q(/bin/bash -c 'while read -e LINE; do history -s $LINE; +echo $LINE; done' |) or die $!; while (<$shell>) { print; }
muahahaha....

Replies are listed 'Best First'.
Re^2: Shell style line-editing without benefit of CPAN modules
by SirBones (Friar) on Nov 20, 2006 at 01:57 UTC

    (As my darling 16 YO daughter would say): O M G

    Thanks so much; that seems to get me most of the way there. If yer weren't so Anonymous, I'd give ya a big ol hug. :-)

    Not to be greedy (always spoken before one gets greedy): I note that this only returns a "history" of the last command entered, at least on the two systems where I tried it. Is there a way to get it to save/scroll a full history list? (As I diligently go back and read the Bash Reference Manual...)

    Most appreciative,

    -Ken

    "This bounty hunter is my kind of scum: Fearless and inventive." --J.T. Hutt

      really? on my bash: BASH_VERSION='3.1.16(1)-release', the above code does keep the the full history of the commands, not just the last command. (that was the hardest part of writing it :) ).

      and i believe that there is probably a way to set a .history file so that it would keep commands between sessions.

      anyway, good luck digging through the bash manpages. i hope you can get it to work "well enough" for your needs. it's probably just one of the bash 'set' options or an environment variable that you need set correctly to make the history work.