I have continuously running script that waits for input and prints 'Wait for input' every 15 seconds to stdout. I need to emulate action of pasting list of IP addresses in stdin while script is running. For example manually i need to do these steps: copy list below including new line after last list element and paste it directly into stdin.
127.0.0.1
127.0.0.2
127.0.0.3
I've tried using pipes and redirections (with both \n and \r) from file with no luck
echo "127.0.0.1\n127.0.0.2\n" | script
or
script < file
where file contain same ip addresses. Any suggestions?