|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/share/zsh/4.2.6/functions/ |
Upload File : |
emulate -L zsh
setopt extendedglob cbases
if [[ $# -ne 1 ]]; then
print "Usage: $0 port
Listen on the given port; send anything that arrives to standard output." >&2
return 1
fi
local REPLY lfd afd
if ! ztcp -l $1; then
print "Failed to listen on port $1" >&2
return 1
fi
lfd=$REPLY
if ! ztcp -a $lfd; then
print "Failed to accept on fd $lfd" >&2
ztcp -c $lfd
fi
afd=$REPLY
cat <&$afd
ztcp -c $lfd
ztcp -c $afd