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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to