ShpielMeister
ShpielMeister

Reputation: 1455

How can Julia shell commands handle pipes?

Using shell commands from within the Julia 1.0 REPL. ; ls works fine, so does ;sort foo

However, I've had no success with pipes, ; ls| sort

shell> ls | sort ls: sort: No such file or directory ls: |: No such file or directory

Any workarounds? I'm running bash on macos.

Upvotes: 3

Views: 631

Answers (1)

niczky12
niczky12

Reputation: 5063

According to the docs, you need to use run and pipeline:

Try running:

run(pipeline(`ls`, `sort`))

Upvotes: 1

Related Questions