Recently, I am installing the PC^2 on my Ubuntu14.04LTS to make up our university's ACM-ICPC Contest environment. But when I run the shell file "pc2server", the system gives me an error alert which is
pc2server: 27: pc2server: Syntax error: "&" unexpected
So I check the file pc2server and find the line 27. I found that the code is
java -d64 -version |& grep -q "Error" && JAVA32=1
I know what syntax |
and &
means, but what I only just want to know is that what syntax |&
means.
From the bash man page:
Pipelines
A pipeline is a sequence of one or more commands separated by one of the control operators
|
or|&
. The format for a pipeline is:[time [-p]] [ ! ] command [ [|│|&] command2 ... ]
The standard output of command is connected via a pipe to the standard input of command2. This connection is performed before any redirections specified by the command (see REDIRECTION below). If
|&
is used, the standard error of command is connected to command2’s standard input through the pipe; it is shorthand for2>&1 |
. This implicit redirection of the standard error is performed after any redirections specified by the command.
Check your hash-bang line. Plain sh doesn't support |&
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With