As far as I know, you can have the ability to make pipes between applications, such as this one:
$ step1 < input_file | step2 | step3 > result_file
And you can access devices such as /dev/urandom
, /dev/zero
. /dev/null
, etc:
$ cat /dev/urandom > "output_file"
$ someprog > /dev/null
My question is, is it possible to make a pipe with a block device both input and output at the same time? For example, I want to read a input_file
, send to /dev/example
(which is rw
), and then read its output into output_file
. Can be achieved on a single command just like this:
$ cat input_file | /dev/example > output_file
or
$ /dev/example < input_file > output_file
or is it advised to do in two commands?
PS: Maybe I'm misspelling the commands or making syntax errors, please let me know how to get it. I use sh
or bash
, I don't know how to use other consoles. If I'm not clear, let me know as English is not my mother tongue.