Himanshu Goyal
Himanshu Goyal

Reputation: 71

How to pass | (pipe) as argument to java command in terminal

I'm trying to run

java -jar jarname |

where | is the pipe delimiter.

But, what's happening is it's thinking of pipe as another terminal command.

TIA

Upvotes: 1

Views: 245

Answers (1)

Konrad Rudolph
Konrad Rudolph

Reputation: 545598

You need to quote the pipe. In most shells (sh/Bash/…), the following works:

java -jar jarname '|'

or

java -jar jarname \|

Upvotes: 2

Related Questions