bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug with edit-and-execute-command and multiline commands


From: Bob Proulx
Subject: Re: bug with edit-and-execute-command and multiline commands
Date: Fri, 6 Aug 2021 20:18:59 -0600

Emanuele Torre wrote:
>     Also here is a paste with some examples by rwp:
>     https://paste.debian.net/plain/1206849

That paste is going to exire so here is the contents of it.

I wanted to show exactly what characters were in the file being edited
and therefore set VISUAL to od in order to dump it.

    $ env VISUAL='od -tx1 -c' bash

    $ echo $BASH_VERSION
    5.1.8(1)-release

    $ if true
    > then echo yes
    > else echo no
    > fiC-xC-e
    0000000  69  66  20  74  72  75  65  3b  20  74  68  65  6e  20  65  63
              i   f       t   r   u   e   ;       t   h   e   n       e   c
    0000020  68  6f  20  79  65  73  3b  20  65  6c  73  65  20  65  63  68
              h   o       y   e   s   ;       e   l   s   e       e   c   h
    0000040  6f  20  6e  6f  3b  20  66  69  0a
              o       n   o   ;       f   i  \n
    0000051
    if true; then echo yes; else echo no; fi
    yes
    > C-xC-e
    0000000  69  66  20  74  72  75  65  3b  20  74  68  65  6e  20  65  63
              i   f       t   r   u   e   ;       t   h   e   n       e   c
    0000020  68  6f  20  79  65  73  3b  20  65  6c  73  65  20  65  63  68
              h   o       y   e   s   ;       e   l   s   e       e   c   h
    0000040  6f  20  6e  6f  3b  20  66  69  0a
              o       n   o   ;       f   i  \n
    0000051
    if true; then echo yes; else echo no; fi
    yes
    > C-xC-e
    0000000  69  66  20  74  72  75  65  3b  20  74  68  65  6e  20  65  63
              i   f       t   r   u   e   ;       t   h   e   n       e   c
    0000020  68  6f  20  79  65  73  3b  20  65  6c  73  65  20  65  63  68
              h   o       y   e   s   ;       e   l   s   e       e   c   h
    0000040  6f  20  6e  6f  3b  20  66  69  0a
              o       n   o   ;       f   i  \n
    0000051
    if true; then echo yes; else echo no; fi
    yes
    > C-d bash: syntax error: unexpected end of file
    exit

I edited in the C-xC-e and C-d so that it would be visible where I
sent those commands.

    $ env VISUAL="ed -p 'ed> '" bash

    $ if true
    > then echo yes
    > else echo no
    > fiC-xC-e
    41
    ed> %p
    if true; then echo yes; else echo no; fi
    ed> q
    if true; then echo yes; else echo no; fi
    yes
    > C-xC-e
    41
    ed> %p
    if true; then echo yes; else echo no; fi
    ed> q
    if true; then echo yes; else echo no; fi
    yes
    > C-d bash: syntax error: unexpected end of file
    exit

Just another rendition of the same thing.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]