I have set up a server with the usual nc - lk <port>
command.
My client sends tcp data to the server socket in the form of xxx,yyy which are numbers.
I want every time the client connects that the values of xxx and yyy would be stored in variables in order to use them later.
From what I understood I must work with pipes, but I am not sure how to do this.
You have two options:
For example:
nc -lk 8889 | while IFS=, read -a p
do echo ${p[1]} ${p[0]}
done
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.