I need to create an echo device for software tests under Raspbian.
The aim is a device, that returns everything. E.g. if I would send some data to a device (ls > /dev/tty30
), I need this data back from this (or an equal) device.
Is there already a possibility out-of-the-shelf inside Raspian? (e.g. an echo device) Can I create such a device by an serial null modem simulation?
Raspbian sure supports such behaviour:
root@raspberrypi:/root# mkfifo /dev/tty100
root@raspberrypi:/root# cat < /dev/tty100 |cat > /dev/tty100&
[1] 19024
root@raspberrypi:/root# echo hi > /dev/tty100
root@raspberrypi:/root# cat /dev/tty100
hi
^C