• [ksh] Readline support in a read-loop ?

    From Janis Papanagnou@21:1/5 to All on Sat Jan 13 11:05:21 2024
    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Or is there a general problem with that idea or such a function?

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sat Jan 13 12:56:03 2024
    In article <untn92$3t3gn$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Don't know much about ksh (don't much about the French I took), but bash
    will do this quite easily. Just include "-e" as an option to "read".

    Or is there a general problem with that idea or such a function?

    No, seems perfectly reasonable to me.

    FWIW, I actually don't like readline much. Prefer "Tecla" (you can Google
    it). I wrote a bash extension library that gives me access to Tecla from
    my bash scripts. The extension library creates a new builtin command
    "getline" that has Tecla editing functionality.

    --
    I love the poorly educated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joerg Mertens@21:1/5 to Janis Papanagnou on Sat Jan 13 13:21:41 2024
    Janis Papanagnou <[email protected]> writes:

    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Or is there a general problem with that idea or such a function?

    You can start your shell with `rlwrap -a´. This should provide readline support on every prompt. However unfortunately this way readline cannot distinguish between the read prompts and the other prompts.

    Another possibility would be to start an external program which reads
    and prints a single line and then wrap this program with rlwrap. Then
    in your script you should be able to capture the line with `word="$(program)"´.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Sat Jan 13 14:56:58 2024
    On 13.01.2024 13:56, Kenny McCormack wrote:
    In article <untn92$3t3gn$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Don't know much about ksh (don't much about the French I took), but bash
    will do this quite easily. Just include "-e" as an option to "read".

    I had searched the bash man page for readline but somehow missed it
    (maybe a typo); but it is there. - Thanks.

    I inspected my script and it may be the least effort to just port
    it from ksh to bash; there's not much ksh specific in it. It seems
    that this is the most convenient solution for me.


    Or is there a general problem with that idea or such a function?

    No, seems perfectly reasonable to me.

    FWIW, I actually don't like readline much. Prefer "Tecla" (you can Google it). I wrote a bash extension library that gives me access to Tecla from
    my bash scripts. The extension library creates a new builtin command "getline" that has Tecla editing functionality.

    I'd be interested to have a look into the built-in. Is it available
    to the public?

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Joerg Mertens on Sat Jan 13 14:51:30 2024
    On 13.01.2024 13:21, Joerg Mertens wrote:
    Janis Papanagnou <[email protected]> writes:

    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Or is there a general problem with that idea or such a function?

    You can start your shell with `rlwrap -a´. This should provide readline support on every prompt. However unfortunately this way readline cannot distinguish between the read prompts and the other prompts.

    Looks interesting. The docs also mention some more tools. - Thanks.

    Too bad that it has no configure script and it requires some newer
    version of Autoconf to build, so currently I can't compile it as
    it is on my Linux. Will have to look into it later...


    Another possibility would be to start an external program which reads
    and prints a single line and then wrap this program with rlwrap. Then
    in your script you should be able to capture the line with `word="$(program)"´.

    I also thought in that direction as a fall-back if there's nothing
    already existing. My first thoughts were to use ksh's KEYBD trap,
    maybe in conjunction with a 'set' discipline function on the 'read'
    variable. But first I look whether I can avoid to invent something
    new.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sat Jan 13 15:08:20 2024
    In article <unu4rb$3v226$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    FWIW, I actually don't like readline much. Prefer "Tecla" (you can Google >> it). I wrote a bash extension library that gives me access to Tecla from
    my bash scripts. The extension library creates a new builtin command
    "getline" that has Tecla editing functionality.

    I'd be interested to have a look into the built-in. Is it available
    to the public?

    I can post it here, if you like. Give me a little time to get it together
    for posting.

    --
    "The most unsettling aspect of my atheism for Christians is
    when they realize that their Bible has no power to make me
    wince. They are used to using it like a cattle prod to get
    people to cower into compliance." - Author unknown

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Weisgerber@21:1/5 to Janis Papanagnou on Sat Jan 13 13:32:01 2024
    On 2024-01-13, Janis Papanagnou <[email protected]> wrote:

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Not in bash, where "read -e" will use readline(3), but it doesn't
    keep any history, so you can't access previous input. It's possible
    to put some text into the readline edit buffer (-i text), so you
    could, say, offer the immediately previous input as a default.

    --
    Christian "naddy" Weisgerber [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Christian Weisgerber on Sat Jan 13 17:11:14 2024
    On 13.01.2024 14:32, Christian Weisgerber wrote:
    On 2024-01-13, Janis Papanagnou <[email protected]> wrote:

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Not in bash, where "read -e" will use readline(3), but it doesn't
    keep any history, so you can't access previous input. It's possible
    to put some text into the readline edit buffer (-i text), so you
    could, say, offer the immediately previous input as a default.

    This is what I experienced as well. So I'll have to look into it.
    Lew's comment indicates that there might be some hope to solve it
    by configuration. I'll see what I find and get...

    BTW, the injection of default data into the read prompt is also
    possible in Kornshell. (I tried it in both shells.) But it's not
    what I need, because I'd then have to clear it constantly, since
    my "normal" use-case is to type in new phrases, but occasionally
    I want some older phrases (mostly the last one) corrected.

    BTW #2, my (desperate) latest try was to define a KEYBD trap and
    if .sh.edchar is a Tab it should replace the input by the data
    line from a tool specific history file, and use ksh's read -s
    option. - It also doesn't work; at least not yet...

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Sat Jan 13 17:00:03 2024
    On 13.01.2024 16:08, Kenny McCormack wrote:
    In article <unu4rb$3v226$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    FWIW, I actually don't like readline much. Prefer "Tecla" (you can Google >>> it). I wrote a bash extension library that gives me access to Tecla from >>> my bash scripts. The extension library creates a new builtin command
    "getline" that has Tecla editing functionality.

    I'd be interested to have a look into the built-in. Is it available
    to the public?

    I can post it here, if you like. Give me a little time to get it together for posting.

    Thanks. And don't worry or hurry, I have plenty of time. :-)

    My tries with bash's read -e failed BTW; yet I have no idea
    why it doesn't work. - Will have to examine it...

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Pozharski@21:1/5 to Janis Papanagnou on Sat Jan 13 16:47:24 2024
    with <untn92$3t3gn$[email protected]> Janis Papanagnou wrote:

    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support into
    such a read loop, so that whenever the prompt is displayed I can skim
    (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    As of zsh (disclaimer: not a ksh-user here)

    % typeset foo= ; vared -p '### ' foo ; echo "($?) ($foo)"
    ### aa bb cc
    (0) (aa bb cc)

    More information 'info zsh vared'. What manual is trying to say should
    be discovered through experiments though. Another caveat: it's not
    clear from getgo if 'vared' would read from stdin and then go for
    editing. Yet another caveat: in 5min I failed to find out how to
    achieve multiline input. Also: obviously it's not readline(3), it's
    zle. Are you distracted enough now?

    *CUT* [ 4 lines 1 level deep]

    --
    Torvalds' goal for Linux is very simple: World Domination
    Stallman's goal for GNU is even simpler: Freedom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jeorge@21:1/5 to Janis Papanagnou on Sat Jan 13 12:09:52 2024
    On 1/13/24 3:05 AM, Janis Papanagnou wrote:
    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    Or is there a general problem with that idea or such a function?

    A while back I was playing with ksh93 and wrote a "Word Of The Day"
    script presents randomly selected words -- a through z -- from the
    system "words" file which can then be selected for dictionary lookup.

    Temporary history files to seed "adjacent words",
    core_word+{s,es,ist,etc}, in the event a definition for the selected
    word wasn't found. The suggested adjacent word(s) are selected via the
    Up/Down arrows and can then be edited similar to readline.

    Anyway, maybe it's useful to you:

    gopher://sdf.org/0/users/jgw/Misc/wotd.ksh

    * lynx(1) or curl(1) support gopher links

    jeorge

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Eric Pozharski on Sun Jan 14 02:32:31 2024
    On 13.01.2024 17:47, Eric Pozharski wrote:
    with <untn92$3t3gn$[email protected]> Janis Papanagnou wrote:
    [...]

    Is there a possibility to somehow get readline(3) editing support into
    such a read loop, so that whenever the prompt is displayed I can skim
    (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    As of zsh (disclaimer: not a ksh-user here)

    % typeset foo= ; vared -p '### ' foo ; echo "($?) ($foo)"
    ### aa bb cc
    (0) (aa bb cc)

    More information 'info zsh vared'. What manual is trying to say should
    be discovered through experiments though. Another caveat: it's not
    clear from getgo if 'vared' would read from stdin and then go for
    editing. Yet another caveat: in 5min I failed to find out how to
    achieve multiline input. Also: obviously it's not readline(3), it's
    zle. Are you distracted enough now?

    Both would be okay. (I neither need multiline, nor a specific readline function.) I just want to be able to get and edit previous inputs most
    simply and least disturbing. - I'll look into it. Thanks.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to jeorge on Sun Jan 14 02:39:19 2024
    On 13.01.2024 20:09, jeorge wrote:

    A while back I was playing with ksh93 and wrote a "Word Of The Day"
    script presents [...]

    Anyway, maybe it's useful to you:

    Quite some code; I'll have a look into it but need some time. - Thanks.


    gopher://sdf.org/0/users/jgw/Misc/wotd.ksh

    Legacy feelings come up... :-)

    I used gopher maybe once around 1990; is it still in use?
    (Good that curl supports it; thanks for the hint.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chuck Martin@21:1/5 to Janis Papanagnou on Sun Jan 14 07:13:13 2024
    On 2024-01-14, Janis Papanagnou <[email protected]> wrote:
    On 13.01.2024 17:47, Eric Pozharski wrote:
    with <untn92$3t3gn$[email protected]> Janis Papanagnou wrote:
    [...]

    Is there a possibility to somehow get readline(3) editing support into
    such a read loop, so that whenever the prompt is displayed I can skim
    (e.g. with cursor keys) through the previous data input?

    If not in ksh; is that maybe possible in bash or zsh ?

    As of zsh (disclaimer: not a ksh-user here)

    % typeset foo= ; vared -p '### ' foo ; echo "($?) ($foo)"
    ### aa bb cc
    (0) (aa bb cc)

    More information 'info zsh vared'. What manual is trying to say should
    be discovered through experiments though. Another caveat: it's not
    clear from getgo if 'vared' would read from stdin and then go for
    editing. Yet another caveat: in 5min I failed to find out how to
    achieve multiline input. Also: obviously it's not readline(3), it's
    zle. Are you distracted enough now?

    Both would be okay. (I neither need multiline, nor a specific readline function.) I just want to be able to get and edit previous inputs most
    simply and least disturbing. - I'll look into it. Thanks.

    The vared command needs -h to use the history. You can also use fc -p
    before using the vared command to push the current history onto a stack
    and switch to a new history list. The fc command can be found in
    "man zshbuiltins" and the vared command in "man zshzle".

    --
    To reply via e-mail, replace "YYMMDD" with the current date in the
    appropriate format, or your mail will bounce. Removing the + and
    everything that follows in my username will also cause your mail to
    bounce. Details: https://nyx.net/~cmartin/HowToEmailMe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sun Jan 14 13:03:14 2024
    In article <unuc23$3ve$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    My tries with bash's read -e failed BTW; yet I have no idea
    why it doesn't work. - Will have to examine it...

    In what way did it "not work" ?

    See the other thread I entered on this. As far as I can tell, in-the-line editing does work, but history doesn't. Is history the main functionality
    that you need?

    FWIW, it sure seems to me that there should be a way to get history to work.

    --
    The whole aim of practical politics is to keep the populace alarmed (and hence clamorous
    to be led to safety) by menacing it with an endless series of hobgoblins, all of them imaginary.

    H. L. Mencken

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Sun Jan 14 19:37:03 2024
    On 14.01.2024 14:03, Kenny McCormack wrote:
    In article <unuc23$3ve$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    My tries with bash's read -e failed BTW; yet I have no idea
    why it doesn't work. - Will have to examine it...

    Yet I haven't found the time to continue the examinations. So just a
    short reply here...


    In what way did it "not work" ?

    I tried with my code and also with the small sample that you provided,
    setting up the two files, etc. - The effect was that I got my prompt
    but arrows (or vi keys or any other random keys) did not show previous
    input.


    See the other thread I entered on this. As far as I can tell, in-the-line editing does work, but history doesn't. Is history the main functionality that you need?

    Yes exactly.

    Entering text on the prompt and typing arrow keys on the actual input
    will position the cursor so that I can, for example, insert some more
    text. (Previously the left-arrow key just created ^[[D^[[D^[[D ...)

    What I primarily needed was to get the previously entered data (which
    has already be confirmed by <return>) back into the prompt. If I can't
    reload the previous text into the prompt the arrow-movement isn't very
    useful [on the empty prompt].

    The use-case is that I send words to a server and depending on the
    server response I may have to adjust/refine the previous input (without
    typing all again).

    Sorry if I was unclear about that.


    FWIW, it sure seems to me that there should be a way to get history to work.

    Yeah, I have to see...

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Janis Papanagnou on Tue Jan 16 09:16:22 2024
    On 13.01.2024 11:05, Janis Papanagnou wrote:
    I'm having a Kornshell script that prompts for input like this

    while IFS= read -r word?"prompt> "
    do process "${word}"
    done

    Is there a possibility to somehow get readline(3) editing support
    into such a read loop, so that whenever the prompt is displayed I
    can skim (e.g. with cursor keys) through the previous data input?

    (After the discussions, a few days of tranquility, and a tasty cup
    of coffee...)

    Now this is embarrassing! - I could make it work also in Ksh, and
    even quite simply; 'readline' isn't necessary at all, Ksh supports
    it natively. - These changes work for me in Ksh...

    $ diff ...
    96a97,101
    HISTFILE="${HOME}/.prompt.history"
    HISTSIZE=50

    set -o vi

    99c104
    < while IFS= read -r word?"prompt> "
    ---
    while IFS= read -r -s word?"prompt> "


    The HISTFILE and HISTSIZE isn't necessary, it just keeps the global
    history clean by using an own history file for this application.

    The 'read -s' is to drop the input data into the history (I already
    tried that before, but that alone didn't work).

    The key was just to also enable the editing 'set -o vi' (which isn't
    taken from the environment or from some configuration files I tried).

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martijn Dekker@21:1/5 to All on Sun Jan 21 03:18:05 2024
    Op 16-01-2024 om 08:16 schreef Janis Papanagnou:
    [...]
    The 'read -s' is to drop the input data into the history (I already
    tried that before, but that alone didn't work).

    The key was just to also enable the editing 'set -o vi' (which isn't
    taken from the environment or from some configuration files I tried).


    Yeah, that's only done for interactive shells. To use emacs or vi with 'read' in a script, you have to set the option yourself.

    Speaking of which, ksh 93u+m/1.0.9 will have a bug fix for 'read -s' that may interest you. You may wish to apply the patch to bltins/read.c locally ahead
    of the release:

    https://github.com/ksh93/ksh/commit/def3415b.patch

    | When emacs or vi mode is activated in a script, 'read -s' should
    | allow the user to arrow up to the current shell history file
    | ($HISTFILE, default ~/.sh_history). But it looks like the history
    | file is not properly initialised for 'read -s' as it does not work
    | on the first invocation:
    |
    | $ ksh -c 'set -o emacs; read -s foo'
    | (type up arrow; beep -- before f840ce81, infinite loop)
    |
    | $ ksh -c 'set -o emacs; read -s foo; read -s foo'
    | (type return, then up arrow; shell history appears)
    |
    | src/cmd/ksh93/bltins/read.c: sh_readline():
    | - Move the code block that initialises the shell history file to
    | immediately before where the first read operation is performed.


    --
    || modernish -- harness the shell
    || https://github.com/modernish/modernish
    ||
    || KornShell lives!
    || https://github.com/ksh93/ksh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Martijn Dekker on Sun Jan 21 10:08:53 2024
    On 21.01.2024 04:18, Martijn Dekker wrote:

    Speaking of which, ksh 93u+m/1.0.9 will have a bug fix for 'read -s'
    that may interest you. You may wish to apply the patch to bltins/read.c locally ahead of the release:

    Thanks for the information and for the fix!

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sun Jan 21 10:58:08 2024
    In article <[email protected]>,
    Martijn Dekker <[email protected]> wrote:
    Op 16-01-2024 om 08:16 schreef Janis Papanagnou:
    [...]
    The 'read -s' is to drop the input data into the history (I already
    tried that before, but that alone didn't work).

    The key was just to also enable the editing 'set -o vi' (which isn't
    taken from the environment or from some configuration files I tried).


    Yeah, that's only done for interactive shells. To use emacs or vi with 'read' >in a script, you have to set the option yourself.

    But in my testing, in bash, setting the "-o vi" did nothing, unless also accompanied by setting interactive mode (-i on the #! line). And in that
    case, the history "works", but is wrong. I.e., when you scroll with
    up/down arrows, you get the lines of the script, not lines you've entered.

    Anyway, that's bash. Maybe it is different in ksh.

    --
    It's possible that leasing office space to a Starbucks is a greater liability in today's GOP than is hitting your mother on the head with a hammer.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Sun Jan 21 17:52:00 2024
    On 21.01.2024 11:58, Kenny McCormack wrote:

    Anyway, that's bash. Maybe it is different in ksh.

    Yes. The 'read' options (names, semantics, available options),
    the 'history' support, and the gory details about interactive
    behavior seems to differ significantly between ksh and bash.
    That's why I had previously considered to even port my script
    to bash. (But since there's a most simple ksh solution I'm of
    course more happy with that.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sun Jan 21 16:59:57 2024
    In article <[email protected]>,
    Christian Weisgerber <[email protected]> wrote:
    On 2024-01-21, Kenny McCormack <[email protected]> wrote:

    But in my testing, in bash, setting the "-o vi" did nothing, unless also
    accompanied by setting interactive mode (-i on the #! line). And in that
    case, the history "works", but is wrong. I.e., when you scroll with
    up/down arrows, you get the lines of the script, not lines you've entered.

    But, as we already established, you can explicitly enable history
    in a noninteractive bash and use "history -s" to push lines into
    the history.

    Oh, OK.

    That just looks like a hokey hack to me, so I kinda stopped paying attention
    at that point.

    Anyway, I'll stick with my getline extension.

    --
    To my knowledge, Jacob Navia is not a Christian.

    - Rick C Hodgin -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Weisgerber@21:1/5 to Kenny McCormack on Sun Jan 21 16:24:18 2024
    On 2024-01-21, Kenny McCormack <[email protected]> wrote:

    But in my testing, in bash, setting the "-o vi" did nothing, unless also accompanied by setting interactive mode (-i on the #! line). And in that case, the history "works", but is wrong. I.e., when you scroll with
    up/down arrows, you get the lines of the script, not lines you've entered.

    But, as we already established, you can explicitly enable history
    in a noninteractive bash and use "history -s" to push lines into
    the history.

    --
    Christian "naddy" Weisgerber [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Thu Jan 25 17:23:03 2024
    On 21.01.2024 17:59, Kenny McCormack wrote:

    Anyway, I'll stick with my getline extension.

    You intended to show us your implementation. Did I miss the post
    or isn't it yet ready to publish?

    Note: I was (and still am) generally interested to see your bash
    extension example. - Just saying, in case you thought I'd not be
    interested any more because I found my ksh based solution.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Thu Jan 25 18:35:38 2024
    In article <uou1t8$2cbe7$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    On 21.01.2024 17:59, Kenny McCormack wrote:

    Anyway, I'll stick with my getline extension.

    You intended to show us your implementation. Did I miss the post
    or isn't it yet ready to publish?

    Thanks for the reminder. I need to get going on that.

    Note: I was (and still am) generally interested to see your bash
    extension example. - Just saying, in case you thought I'd not be
    interested any more because I found my ksh based solution.

    Good to know. Thanks.

    --
    Just remember:

    Pence is all the evil, with none of the crazy.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)