I'm trying to create some test network traffic by sending TCP traffic using netcat.
The issue is that the netcat command to receive TCP data doesn't end on its own, which makes perfect sense.
I'm wondering how I can have a script that continues running to the send portion of the TCP traffic. Something similar to:
#!/bin/bash
#Prepare to receive traffic
nc -vv -l -p 5000 > receiveData.txt
#Send traffic
nc -nvv localhost 5000 < sendData.txt
Obviously the script will never get to the #Send traffic line because the receive traffic never ends. I've been looking at methods for running functions in bash asynchronously, but nothing I've read seems to solve this problem.