zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: Bart Schaefer <schaefer@candle.brasslantern.com>
Cc: Zefram <zefram@fysh.org>, zsh-workers@sunsite.auc.dk
Subject: Re: FPATH/autoload still strange in -dev-21
Date: Thu, 6 Apr 2000 18:21:10 +0100 (BST)	[thread overview]
Message-ID: <E12dFxv-00026v-00@crucigera.fysh.org> (raw)
In-Reply-To: <1000406164211.ZM16541@candle.brasslantern.com> from Bart Schaefer at "Apr 6, 2000 04:42:11 pm"

Bart Schaefer wrote:
>Hmm.  "2>& foo" does indeed do so, but "2&> foo" only makes one copy.  Is
>that also expected?

Hmm.  It appears that "2&>" is treated as "2 &>" -- the "&>" isn't
recognised as a redirection operator for the purposes of parsing the
I/O number.

% echo x 2&> foo
% cat foo
x 2
% echo x 2>& foo
x
% cat foo
% 

Curiously enough, bash (2.03.0(1)) does the same thing.

-zefram

Index: ChangeLog
===================================================================
RCS file: /cvsroot/zsh/zsh/ChangeLog,v
retrieving revision 1.27
diff -c -r1.27 ChangeLog
*** ChangeLog	2000/04/06 16:44:02	1.27
--- ChangeLog	2000/04/06 17:16:32
***************
*** 1,5 ****
--- 1,9 ----
+ 2000-04-06  Andrew Main  <zefram@zsh.org>
+ 
+ 	* zefram2: Src/lex.c: Support "3&> foo" etc.
+ 
  2000-04-06  Andrew Main  <zefram@zsh.org>
  
  	* zefram1: configure.in, Etc/zsh-development-guide: List of tools
  	required for development work, and a little more conspicuous
  	explanation of the config.status hack.
Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.2
diff -c -r1.2 lex.c
*** Src/lex.c	2000/04/04 01:16:25	1.2
--- Src/lex.c	2000/04/06 17:16:33
***************
*** 642,648 ****
  	return DOUTPAR;
      } else if (idigit(c)) {	/* handle 1< foo */
  	d = hgetc();
! 	if (d == '>' || d == '<') {
  	    peekfd = c - '0';
  	    c = d;
  	} else {
--- 642,659 ----
  	return DOUTPAR;
      } else if (idigit(c)) {	/* handle 1< foo */
  	d = hgetc();
! 	if(d == '&') {
! 	    d = hgetc();
! 	    if(d == '>') {
! 		peekfd = c - '0';
! 		hungetc('>');
! 		c = '&';
! 	    } else {
! 		hungetc(d);
! 		lexstop = 0;
! 		hungetc('&');
! 	    }
! 	} else if (d == '>' || d == '<') {
  	    peekfd = c - '0';
  	    c = d;
  	} else {
***************
*** 702,707 ****
--- 713,719 ----
  	else if (d == '!' || d == '|')
  	    return AMPERBANG;
  	else if (d == '>') {
+ 	    tokfd = peekfd;
  	    d = hgetc();
  	    if (d == '!' || d == '|')
  		return OUTANGAMPBANG;
***************
*** 715,721 ****
  	    }
  	    hungetc(d);
  	    lexstop = 0;
- 	    tokfd = -1;
  	    return AMPOUTANG;
  	}
  	hungetc(d);
--- 727,732 ----


  reply	other threads:[~2000-04-06 17:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-06  8:18 Sven Wischnowsky
2000-04-06  9:51 ` Bart Schaefer
2000-04-06 15:56   ` Zefram
2000-04-06 16:42     ` Bart Schaefer
2000-04-06 17:21       ` Zefram [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-04-06 10:49 Sven Wischnowsky
2000-04-05  8:03 Sven Wischnowsky
2000-04-05  5:09 Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E12dFxv-00026v-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).