[SATLUG] Check if stdin is empty when using socat
rabie at rabie.net
Thu Dec 4 09:06:32 CST 2014
I m using socat to transfer file from one server to another. I have the
following command running in the background on one of the servers
socat tcp-l:8989,reuseaddr,fork exec:/opt/scripts/printdoc.sh
and in printdoc.sh I have the following code :
while [ $rtval != 0 ]; then
cat - >> /opt/scripts/docs/$filename
Do something else down here ..
Now when I cat a file from the other server, my script triggers but it
never goes outside the while loop, somehow it is not reading the exit
code $? it should be grater than 0
any thoughts ?
More information about the SATLUG