Im using netcat to send files to another pc, using a client and a server. the problem is when i send a file from server to client, the content of the file is send, but the program doesnt continue in both computers.
Code from server:
($nc -nlv $server < xa.txt)
Code from client:
($nc $ip_server $door > xa1.txt)
echo "done"
In this case doesnt show the echo, and recieves the file in the console, made the connections and the square is full colour.
That's normal:
netcat
reads until end of input on one side, and writes until end of connection. It is designed like this.If you want to transfer several file, use a protocol intended for this:
sftp
,scp
,rsync
.Another way is to use
tar
andnetcat
. On the receiving end do:and on the sending end do: