tee, but not in the file and to the udp port


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
I a teapot in Linux, so svinia for the confusion the wording of the question.
The cough run command
my_process 2>&1 | tee -a log.txt
Ie, stdout, and stderr of the process are saved in a file and are visible on the console.
Should be possible just to do the same, but instead of log.txt send stdout and stderr via the UDP address of the form 177.22.37.11:6800
Thanks in advance to all respondents on the merits.
by | 5 views

3 Answers

0 like 0 dislike
Use netcut
my_process 2>&1 | tee | nc 177.22.37.11 6800
by
0 like 0 dislike
I would be a little more careful — not every distribution available in the bash /dev/tcp and /dev/udp.
You can use netcat (called as nc, is the default almost everywhere)
\r
Accordingly,
\r
#!/bin/sh dummy mkfifo cat dummy | nc-u 177.22.37.11 6800 my_process 2>&1 | tee -a dummy rm dummy 

\r
The-u switch selects UDP, if you do not specify — default TCP.
by
0 like 0 dislike
#!/usr/bin/env bash dummy mkfifo cat dummy > /dev/udp/177.22.37.11/6800 & my_process 2>&1 | tee -a dummy rm dummy 
by
110,608 questions
257,186 answers
0 comments
27,880 users