# First, lets introduce some of the commands we will # be using. The commands marked with "***" will be # covered in detail in later chapters. Refer to the # man pages for more info. # # cat - copies its input to its output # diff - compares two files *** # patch - applies the changes in a diff *** # ncftp - ftp client program # lynx - text mode web broswer # tar - pack and unpack tar archives # cd - change current directory # make - drives the compilation process *** # echo - display its arguments # echo hello, world - says "hello world" # # These are some examples of shell magic, see the bash # man page for more details: # # - marks a comment line # foo=bar - set variable foo equal to bar # export FOO=bar - similar, but subprocesses will inherit value # echo $(foo) - substitute $(foo) into # xxx | yyy - pipe output of command xxx into command yyy # xxx >yyy - redirect the output of command xxx to file yyy # xxx >>yyy - same, but append to file yyy # xxx gnozzle-0.63.tar.gz # Here we unpack the tarball, after first checking # the directory structure cd /usr/local/src tar ztvf gnozzle-0.63.tar.gz tar zxvf gnozzle-0.63.tar.gz cd gnozzle-0.63/ # Here we create a permanent record of changes we # made using a text editor as a patch command. In this # case, we changed the values of CC and PREFIX in the # file Makefile. The patch has one hunk which spans # lines 1 through 7. # # the following patch was made like this: # cp Makefile Makefile.orig # emacs Makefile # diff -u Makefile.orig Makefile # beware of mangled whitespace (especially tabs) when # cutting and pasting. patch Makefile <<\...END.OF.PATCH... --- Makefile.orig Mon Feb 22 21:12:41 1999 +++ Makefile Mon Feb 22 21:13:14 1999 @@ -1,7 +1,7 @@ VERSION=0.63 -CC=pcc +CC=gcc CFLAGS=-g -PREFIX=/usr +PREFIX=/usr/local BIN=$(PREFIX)/bin LIB=$(PREFIX)/bin MAN=$(PREFIX)/man/man1 ...END.OF.PATCH... # Here we build the program and install it make clean make make -n install # see what it would do first make install # Here we create a new file with a couple lines of text cat >/etc/gnozzle.conf <<\...EOF... gnozzlelib=/usr/local/lib/gnozzle allow ...EOF... # Here, we append a couple lines to the magic file, # which is used by the some commands to # guess the type of a file, to add the characteristic # signature of a gnozzle data file. cat >>/usr/share/magic <<\...EOF... # gnozzle 0 long FEDCBA98 Gnozzle data file ...EOF...