I wish to have a customized device to echo a specific value like /dev/zero
or /dev/random
. But /dev/zero
always outputs 0, /dev/random
outputs a random number.
The specific value may be configured, for example — 0x1234, 0x4321, 0xF6, or some ASCII streams Yes
and No
.
How do I create such a device?
Best Answer
Quoting from How is /dev/zero created and how can I make variants like /dev/one? (on SuperUser):
Unless you really need a device file, just use the
yes
command, which repeats its arguments ad infinitum (ory
, if no argument is given):Also see: