A
A
Aryeh Leonid R.2011-01-18 14:40:42
linux
Aryeh Leonid R., 2011-01-18 14:40:42

tee, but not to a file, but to udp port

I'm a linux nerd, so apologies for the rambling question.
In the shell, run the command

my_process 2>&1 | tee -a log.txt


Ie . The stdout and stderr of the process are saved to a file and visible on the console.
It is necessary to do the same as simply as possible, but instead of log.txt send stdout and stderr to a UDP address like 177.22.37.11:6800
Thanks in advance to all who answered in essence.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
Y
Yur4eg, 2011-01-18
@Yur4eg

Use netcut
my_process 2>&1 | tee | nc 177.22.37.11 6800

@
@ntkt, 2011-01-18
_

I would be a little more careful - not every distribution has /dev/tcp and /dev/udp available in the bash.
You can use netcat (called as nc, there is a default almost everywhere)
Accordingly,


#!/bin/sh

mkfifo dummy
cat dummy  | nc -u 177.22.37.11 6800
my_process 2>&1 | tee -a dummy
rm dummy

The -u switch selects UDP, if not specified, the default is TCP.

U
umcherrel, 2011-01-18
@umcherrel

#!/usr/bin/env bash

mkfifo dummy
cat dummy  > /dev/udp/177.22.37.11/6800 &
my_process 2>&1 | tee -a dummy
rm dummy

B
Bright, 2011-05-23
@Bright

1. Yes, a month and a half is enough.
Plus, when transferring, the registration period is extended for a year.

X
xaker1, 2011-05-23
@xaker1

2. I don’t see the point, because domain delegation does not stop during the transfer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question