Or use the yes command
yes R | nc localhost 123 > fifo
not sure this will work inside of a bash script though