On Fri, 5 Jul 2019 at 08:44, Ralph Corderoy <ra...@inputplus.co.uk> wrote:
> (yada yada) |& curl -sSF 'f:1=<-' ix.io

On Fri, 05 Jul 2019 11:42:22 +0100, Victor Churchill wrote:
> I was puzzled to see the '&' in your command above. I'd have thought that
> saying
> (yada yada) | curl -sSF 'f:1=<-' ix.io
> would do the trick

In bash(1), |& is one operator, not two.

From the manual:
> If |& is used, command's standard error, in addition to its standard
> output, is connected to command2's standard input through the pipe; it
> is shorthand for 2>&1 |.

On Fri, 05 Jul 2019 11:42:22 +0100, Victor Churchill wrote:
> [I'd have thought that] adding the ampersand would, if anything, cause
> it to break: "pipe this lot to nothing, and while you're about it
> run this curl with no stdin"

I think that would be the meaning if you were to put a space between | and &:

    (yada yada) | & curl -sSF 'f:1=<-' ix.io

But that form produces a syntax error.

    $ echo "dogs" | & cat
    bash: syntax error near unexpected token `&'
   

Patrick
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to