File: tcp_shoot

package info (click to toggle)
zsh 4.3.6-6
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 14,436 kB
  • ctags: 7,192
  • sloc: ansic: 87,447; sh: 5,590; makefile: 836; perl: 619; awk: 381; sed: 16
file content (21 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
emulate -L zsh
setopt extendedglob

local REPLY tfd

if [[ $# -ne 2 ]]; then
    print "Usage: tcp_dump host port
Connect to the given host and port; send standard input.">&2
    return 1
fi

if ! ztcp $1 $2; then
    print "Failed to open connection to host $1 port $2" >&2
    return 1
fi

tfd=$REPLY

cat >&$tfd

ztcp -c $tfd