3
3
3vi1_0n32015-04-19 22:14:39
linux
3vi1_0n3, 2015-04-19 22:14:39

Why doesn't the od command pass output to the pipe?

When using the od command, no result is passed to the next command through the pipe. Although at the same time there is an output to the console, if not redirected anywhere. Why is that? And is it possible to do it somehow?
This option works:
nc -u -l -p 53 | od -An -t u1 -w1 -v
Everything is displayed in the console as it should.
This option does not work:
nc -u -l -p 53 | od -An -t u1 -w1 -v > result.txt
And this option does not work:

nc -u -l -p 53 | od -An -t u1 -w1 -v | (
read a
echo $a
)

PS: Updated the command

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2015-04-20
@jcmvbkbc

Everything works.
Try
strace -v -f -o log bash -c "cat file | od -An -t u1 -w1 -v > result.txt"
and either see for yourself what happens at the moment the result.txt file is opened and then when you try write to it, or post the resulting log.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question