I have Vowpal Wabbit daemon running, which I started with following command:
vw -i X_b123.model -t --quiet --daemon --port 26542 -r /dev/stdout
Then i try to send something to daemon:
echo 'somedataforwovpal' | netcat localhost 26542 -q1
I get answer, like this (both lines are the answer):
1:-0.0268077 2:-0.0990701 3:-0.154975
2
For now, everything is perfect and correct. What i want, is just send this output to file. And this is the point that drives me crazy. Why? Usually i would do it simple, by sending stdout to file like this:
echo 'somedataforwovpal' | netcat localhost 26542 -q1 > myfile.txt
Well, this worked only partially. The file was created, but it contains only the second line of output (just the number 2), and first line 1:-0.0268077 2:-0.0990701 3:-0.154975 is still print to console.
So my idea was, that the second part is going to stderr, so I tried several following ways to save stderr/stdout output:
echo 'somedataforwovpal' | netcat localhost 26542 -q1 2> myfile.txt
echo 'somedataforwovpal' | netcat localhost 26542 -q1 2>&1 > myfile.txt
echo 'somedataforwovpal' | netcat localhost 26542 -q1 &> myfile.txt
echo 'somedataforwovpal' | netcat localhost 26542 -q1 > myfile.txt 2>&1
echo 'somedataforwovpal' | netcat localhost 26542 -q1 >> myfile.txt
script -c "echo '1 |w auto_t dum_qt |f auto_t dum_qt |m qm_pos_2' | netcat localhost 26542 -q1" myfile.txt
Did not worked, still same. None of these methods, as you can see, i even tried script, but still same. This really drives my crazy, please, is there anybody who could save me?