[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Read builtin -e (readline) oddities
From: |
Chet Ramey |
Subject: |
Re: Read builtin -e (readline) oddities |
Date: |
Mon, 19 Jun 2017 15:40:14 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 6/18/17 9:39 PM, Eduardo A. Bustamante López wrote:
> I'm trying to figure out a way to fuzz >>read -e -d ""<<, without having the
> fuzzer break due to the temporary files created by fc.
>
> While doing this, I noticed the oddities described below.
>
>
> #1
> Hit `C-x C-e' twice. The value of PATH seems to be ignored for the second
> line.
>
> dualbus@debian:~$ PATH= read -e
>
> bash: vim: No such file or directory
>
> echo hi
> hi
>
>
> #2
> Spurious `;'s are inserted into the history.
>
> dualbus@debian:~$ history -c
> dualbus@debian:~$ PATH= read -e
>
> bash: vim: No such file or directory
>
> echo hi
> hi
>
> dualbus@debian:~$ history
> 1 PATH= read -e; ;
> 2 echo hi
> 3 history
>
>
> #3
> Hit `C-x C-e' thrice. Also, the mapping of `\C-m' became `self-insert' instead
> of `accept-line'.
`read -e' changes it because it's no longer the line delimiter.
> dualbus@debian:~$ PATH= EDITOR=: read -e -d ''
>
> PATH= EDITOR=: read -e -d '';
>
> fc -e "${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}"
> : /tmp/bash-fc.IZAzmF
> PATH= EDITOR=: read -e -d ''; ;
> bash: syntax error near unexpected token `;'
>
> fc -e "${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}"
> vim /tmp/bash-fc.35ePED
> ^M^M^C
I'll have to check why it doesn't get restored on ^C.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/