Typo
[linux_from_scratch_hints.git] / OLD / netcat.txt
blob6c4ab048f3982aab002ab7770ec49b469ea8edea
1 TITLE:          netcat
2 LFS VERSION:    All
3 AUTHOR:         Gintautas Miliauskas <gintautas.m@centras.lt>
5 SYNOPSIS:
6         Getting netcat to compile on LFS.
8 netcat is a very useful tool for various small networking tasks. It's
9 capabilities are somewhat similar to cat, it just works with IP addresses and
10 port numbers instead of file paths. It supports piping, opening sockets for
11 listening and a few other simple, but very handy features.
13 You can get this utility here:
14 http://www.atstake.com/research/tools/index.html   (section 3)
16 Direct link:
17 http://www.atstake.com/research/tools/nc110.tgz
19 Installation:
21 mkdir netcat &&
22 tar -C netcat -xvzf nc110.tgz &&
23 cd netcat &&
24 mv netcat.c netcat.c~ &&
25 sed -e 's/res_init();/\/\* res_init(); \*\//' <netcat.c~ >netcat.c &&
26 mv Makefile Makefile~ &&
27 sed -e 's/CFLAGS =/# CFLAGS =/' -e 's/\$(STATIC)//' <Makefile~ >Makefile &&
28 make linux &&
29 cp nc /usr/bin
31 The first sed fixes a small bug, if you don't trust it, you can manually
32 comment or remove line #312 of the file netcat.c. The first part of the second
33 sed enables CFLAGS set in your environment (it comments out the implied -O), the
34 second part enables dynamic linking, you may leave it out if you want a static
35 binary.
37 Browse the directory for more info about usage of netcat. A quick command-line
38 reference is available by `nc -h'.