bug-bash
[Top][All Lists]
Advanced

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

Re: RFE? |> ?


From: Chet Ramey
Subject: Re: RFE? |> ?
Date: Mon, 17 Dec 2007 22:55:21 -0500
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Linda Walsh wrote:
> I was wondering about a possible RFE and whether or not
> it is "inadvisable" or not.  I'd be surprised if no one had
> thought of it -- so maybe there is a problem in doing it.
> 
> Just like:
>     &>word            #(preferred syntax)
>  and
>    >&word
>  are semantically equivalent to ">word 2>&1"
> 
> Has it been thought to make
>    |>word            #(preferred form)
>  semantically equivalent to "2>&1 | word" ?

There have been a few proposals for some mechanism combining redirection
and piping in this way, but I haven't really liked any of the suggested
notations.  Note that "|>word" already has a well-defined meaning, and
your proposal isn't backwards-compatible.  (That's a common problem.
The shell syntax is running out of reasonable character combinations.)

zsh uses |&, which is not bad, though ksh uses that to run a coproc.  I
also like the vaguely rc-like [n]| to mean "n>&1 |", but that's a harder
parse.

> I note that ">|" is used to "emphatically overwrite a
> pre-existing file when the "-c" option is used to prevent
> overwrites.  Why wasn't ">!" used for that?

Because >| was existing practice.

> Also, along the same lines (but less useful, IMO) would be
>     &>>word       #(append stderr & stdout to word)

That's reasonable.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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