Andrey
Andrey

Reputation: 400

How can I redirect output in Bash

I work with program which usage is "program input-file output-file". How can I write the result in STDOUT and don't write it into the output-file. Thanks.

Upvotes: 0

Views: 98

Answers (2)

geekosaur
geekosaur

Reputation: 61369

Use /dev/fd/1 or /dev/stdout as the output file. Some programs will recognize - to mean stdout, or will even use it automatically if the output file is omitted, but this is up to the individual program (unlike the /dev ones which are system services, although sometimes emulated by shells on systems that lack them).

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798466

Put /dev/stdout as the output filename.

Upvotes: 2

Related Questions