[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: premature script end
From:       Hinko Kocevar <hinko.kocevar () cetrtapot ! si>
Date:       2008-12-19 10:42:51
Message-ID: 494B7AAB.6060008 () cetrtapot ! si
[Download RAW message or body]

Michael Abbott wrote:
> Fri, 19 Dec 2008, Hinko Kocevar wrote:
>> Why does below script end after first iteration?
> ...
>> while read var; do
>> 	nc $ip $port
>> done < /tmp/foo
> 
> Your problem is that nc eats your input: in effect you're transmitting the 
> rest of /tmp/foo to $ip:$port!
> 
> If you don't want to send anything, then
> 
> 	nc $ip $port </dev/null
> 
> should do the trick.

Yep, that did it!
Thank you!!

Regards,
Hinko

-- 
Hinko Kočevar, OSS developer
ČETRTA POT, d.o.o.
Planina 3, 4000 Kranj, SI EU
tel     ++386 (0) 4 280 66 03
e-mail  hinko.kocevar@cetrtapot.si
http    www.cetrtapot.si

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic