Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh beta21 bug?: exec =()



> 
> This worked with all previous beta version of zsh, but fails
> with beta 21...
> 
>     % cat ztest
> 
> 	exec 3< =(ls -C)
> 	while read line <&3
> 	do
> 	    echo "line = $line"
> 	done
> 	exec 3<&-
> 
>     % zsh-2.6b21 ztest
>     ztest: parse error [2]
>     ztest: 3: bad file number [3]

I think that < =(...) is useless since it is really the same as < <(...).
But now I see that it can be useful sometimes so the patch below enables it
again.  But the above script can be rewritten:

coproc ls -C
while read -p line
do
	echo "line = $line"
done

Zoltan


*** Src/parse.c	1996/06/20 20:31:54	2.12
--- Src/parse.c	1996/06/20 20:39:58
***************
*** 1225,1231 ****
  	if (toks[0] == Outang && toks[1] == Inpar)
  	    /* > >(...) */
  	    fn->type = OUTPIPE;
! 	else if ((toks[0] == Inang || toks[0] == Equals) && toks[1] == Inpar)
  	    YYERRORV;
  	break;
  
--- 1225,1231 ----
  	if (toks[0] == Outang && toks[1] == Inpar)
  	    /* > >(...) */
  	    fn->type = OUTPIPE;
! 	else if (toks[0] == Inang && toks[1] == Inpar)
  	    YYERRORV;
  	break;
  
***************
*** 1233,1239 ****
  	if (toks[0] == Inang && toks[1] == Inpar)
  	    /* < <(...) */
  	    fn->type = INPIPE;
! 	else if ((toks[0] == Outang || toks[0] == Equals) && toks[1] == Inpar)
  	    YYERRORV;
  	break;
      case READWRITE:
--- 1233,1239 ----
  	if (toks[0] == Inang && toks[1] == Inpar)
  	    /* < <(...) */
  	    fn->type = INPIPE;
! 	else if (toks[0] == Outang && toks[1] == Inpar)
  	    YYERRORV;
  	break;
      case READWRITE:




Messages sorted by: Reverse Date, Date, Thread, Author