Tjax
Tjax

Reputation: 333

Redirect output to two unnamed pipe Linux

I would like to do this in a bash script:

tail -n0 -F /var/log/kern.log > $pipe1 AND $pipe2

where $pipe are two unnamed pipes. I know it can be done using tee command but I could not get it to work.

Upvotes: 1

Views: 312

Answers (1)

Jahid
Jahid

Reputation: 22438

This should work:

tail -n0 -F /var/log/kern.log | tee "$pipe1" "$pipe2" >/dev/null

The tee output is being redirected to /dev/null and is prevented it to be printed on terminal.

Upvotes: 1

Related Questions