Use nc to write multiple files - how?

前端 未结 3 1876
误落风尘
误落风尘 2021-01-28 06:31

I want to use nc as a simple TCP/IP server. So far I run it using:

$ nc -k -l 3000 > temp.tmp

This works, but writes all the re

3条回答
  •  深忆病人
    2021-01-28 07:17

    Omit the -k and run it in a loop:

    n=0
    while nc -l 3000 > "$n".txt ; do
       n=$((n+1))
    done
    

提交回复
热议问题