conn-tools
Software
www.skarnet.org
The recvenv program
recvenv receives certain environment variables over
the network, as sent by
sendenv.
Interface
recvenv [ -c | -d ] [ var... ] ; prog...
- recvenv reads the values of some environment variables
sent by a peer sendenv process. If the name of a variable
sent by sendenv is listed in var..., recvenv
sets it to the value sent by sendenv.
- recvenv then execs prog....
- If a hard error occurs, recvenv exits 111.
- The var... list is terminated by a single semicolon.
If you call recvenv within a shell script, be careful to
quote the semicolon to prevent it from being interpreted by the shell.
- CAUTION: If the var... list is empty,
recvenv will accept any variable setting it
receives over the network. This is a security risk, and is provided
for convenience only.
Options
- -c : client mode. Read from descriptor 6 and write
to descriptor 7.
- -d : server mode. Read from descriptor 0 and write
to descriptor 1. This is the default.
Example
#!/bin/sh
exec tcpserver host port recvenv ZOINX \; prog
will run prog everytime a client connects to
host:port with a proper sendenv. If the
ZOINX environment variable is sent by the client, recvenv
will set it to the sent value before running prog.