Not sure if this is a bug or a limitation but this works:

# echo a | ( exec {fd}>/path/to/regular/file; tee /dev/fd/"$fd" )

While this produces a "No such device or address" error:

# echo a | ( exec {fd}>/dev/tcp/host/port; tee /dev/fd/"$fd" )

Simpler forms like this does the same:

# echo a | tee /dev/fd/4 4>/dev/tcp/host/port
# echo a | ( tee /dev/fd/4 ) 4>/dev/tcp/host/port

The workaround is to use process substitution and cat:

# echo a | tee >( cat > /dev/tcp/host/port )

Tested in 5.1.4.

-- 
konsolebox

Reply via email to