bash: socket redirection?
for my problem i give a little example:
1. execute this:
exec 5<>/dev/tcp/www.google.com/80
(now we have a connection to google using descriptor 5)
2. create a shell script (google.sh)
#[begin]
echo -e "GET / HTTP/1.0\n" >&5
cat <&5 1>/dev/null
#[end]
the script sends a get request using descriptor 5 (e.g. to google)
and retrieves the result (since i don't need everything on stdout i redirect it to /dev/null)
3. execute the shell script
what i need is transparent logging
this means, everything which is sent or received (in this example using descriptor 5) should be logged to a file (or two files, ingoing, outgoing)
i thought about using tee to redirect 5 to stdin/stdout or something
but i have no idea how to do this
any suggestion would be great
thx@ll
|