'Redirect commands to telnet process

I've got a GNS3 project with multiple virtual switches. I would like to execute commands from file at all devices in the same time. Communication with virtual devices is made by telnet, so I can for example redirect command string to /proc/PID/fd/0 and it works, but can not make it to confirm the command (basically cant "press enter" this way). How can I do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source