Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z - Internet FAQ Archives

comp.lang.tcl Frequently Asked Questions (Mar 05, 2005) (3/6)
Section - -P- The patch and gzip commands, along with other useful utilities

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]

Top Document: comp.lang.tcl Frequently Asked Questions (Mar 05, 2005) (3/6)
Previous Document: -O- http files without a WWW client
Next Document: -Q- Source code from published books
See reader questions & answers on this topic! - Help others by sharing your knowledge
The patch command is used to apply updates to a source package.  It
assumes that you have the previous version of the source package in
an uncompressed format as well as a file containing one or more modifications
that need to be applied to the original code.

The GNU project's version of the patch command is the one most commonly
used on USENET.  The primary archive for this project is
<URL: >.  You will find the source code
located at this FTP site.  Source code for the gzip package, a very
common compression format used on Unix (files compressed with gzip
typically end in either .gz or .tgz), can be found at this site as
well.  For binary versions of either of these programs, you will have
to search what ever the appropriate archive sites are for your

First, get a version of patch and compile and install it.  Then you
might follow a hypothetical scenario such as this:

The tcl8.3/README says "apply them to the source directory"!

$ mkdir /usr/tcl83	# Pick this directory as appropriate
$ cd /usr/tcl83
$ mv $HOME/tcl8.3.0.tar.gz /usr/tcl83/.
$ mv $HOME/tcl8.3.1.patch.gz $HOME/tcl8.3.2.patch.gz /usr/tcl83/.
$ mv $HOME/tcl8.3.3.patch.gz /usr/tcl83/.
$ gzip -d < $PWD/tcl8.3.0.tar.gz | tar xvf -
$ cd tcl8.3
$ gzip -d < ../tcl8.3.1.patch.gz | patch -p1
$ gzip -d < ../tcl8.3.2.patch.gz | patch -p1
$ gzip -d < ../tcl8.3.3.patch.gz | patch -p1
$ $PWD/configure --prefix=/usr/tcl83
$ make
$ make test
$ make install

assuming your *.gz files all reside in your $HOME directory initially.
This ends up creating a /usr/tcl83/bin, include, and lib directory.
The binary program tclsh8.3 goes into /usr/tcl83/bin .

If you already have gunzip-ed the files in a different directory (such
as /usr/tcl83/patch/), you could use them like this:

$ cd /usr/tcl83/tcl8.3
$ patch -p < ../patch/tcl8.3.1.patch

You will get messages from patch ("hmm, this looks like" and "hunk #n
succeeded") which will scroll off your screen quite fast.  One user has
suggested that if you are using Unix, you can use the script command to
keep all of the output in a log file which you can then peruse later.

You should not get rejected, failed, or wrong version messages.  If you
get those types of messages, you may have missed a patch that needed to be
made, or may be attempting to patch a version of the files not intended to be
patched, or may be in an incorrect directory, or using a bad version of

If the patch is being applied later, you will want to execute a "make
clean" before the make without arguments, to be sure that you have
gotten rid of any files which need to be recreated during the install

You need to be careful as well trying to perform make on different
machines - if you have to switch computers between makes, you should
execute a "make distclean" followed by another configure command.
This ensures that the various assumptions made by the configuration
program are accurate.  Another alternative would be to create different
subdirectories for each hardware/software platform on which you build
the tcl binaries.

Also, be aware that most patches to date have been built expecting
patch version 2.1.  Patch version 2.2 thru 2.3 at least, and perhaps
version 2.4, have had incompatibilities that may fail in peculiar ways.
Also note that at least Solaris 2.5.1 comes with a patch command quite a bit
older than 2.1, and it too is incompatibile with many patch files, causing
many different kinds of failures.

Another command to which <URL: news:comp.lang.tcl > users sometimes are
referred is a command history filter.  These are programs which sit between
the user's shell and a program and attempt to provide a history mechanism
to commands which have no such capability.  The most frequently mentioned
of these programs is "ile".   The master site for the newest version of
ile is <URL: >.
Another commonly referred command history program is "fep".  The master ftp
site for the source code for it is
<URL: >.
A useful place to begin looking for source code for these and other
programs is <URL: > and its mirrors.  A WWW site for
this would be <URL: >.

Windows users have begun asking how to format and display the man pages
which come with Tcl, Tk and other applications.  One recently recommended
tool was CAWF.  Cawf v1.0 is a C version of the nroff-like
"Amazingly Workable (text) Formatter. Source & executables are available
at various DOS software archives such as <URL: >.
With cawf, it seems likely you could format the raw nroff into text.

Another alternative might be <URL: >
which is a Perl script which formats raw roff codes into formatted output.

<URL: >
is another of this genre - perl scripts which convert man pages to
html without using nroff.

<URL: > is a Scheme
package which translates *roff documents into HTML.

Then, you could go to <URL: > and
pick up the man2html, which will take the formatted files produced
and generate HTML.  Or you could get RosettaMan , which is a part of
the TkMan suite.

In the tknt package (which was a port of Tcl/Tk/Tcl-DP/BLT/incr tcl to
Windows NT, there was included a file containing the
free source for a utility which converted the Tcl man pages into WinHelp
pages.  There are of course commercial packages that folk will be willing
to sell you for this purpose as well.

The package
<URL: > has
a README which begins:
        This is a port of GNU Groff version 1.10 to DJGPP v2.01 or later.

It appears to work even under MSDOS, not just Win*.
Find the home page for DJGPP at <URL: >.

Another user suggestions locating a package called DOS/DPMI from a simtel
mirror site to find Windows versions of man.exe and groff.

To extract files from gzip'd tar files while using Windows, see Winzip
<URL: >.  I believe there is a free alternative -
perhaps someone will let me know about it.

<URL: >
is a distribution of common GNU utilities ported to native Win32.

Another useful utility, this time for the Macintosh folk, is suntar, which can
extract files from a tar file.

I have seen notes indicating that Tcl and Tk can be compiled using the
gcc free compiler in unix as well as Win32 (EGCS, FSF, cygwin32, mingw32)
environments.  Also, Win32's lcc should work.  See
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >
<URL: >

In gnu-win32 directory on cygnus, fetch either usertools.exe for the user level
Unix-like tools, or cde.exe for the complete C development environment.
At the sourceware web site, pick the full.exe file to install a full
development environment.

Many users mention using the bash shell or other similar shells on their
Windows machines, so that they can get a mechanism similar to #! on Unix
for launching their scripts.

Be sure that you understand
<URL: > very well,
perhaps even discussing it with a lawyer, before using cygwin to produce
software you wish to sell.  Nothing there prevents you from doing this -
however, there are a variety of considerations that one needs to make, when
using tools some of which are covered by the GPL.

Some users ask about additional sources of icons to use.  One person suggests
<URL: >.

Emacs can convert Tcl code into HTML using the M-x htmlize-buffer command
on an Emacs buffer full of Tcl.  This requires Hrvoje Niksic's htmlize.el
package.  Contact Emil Astrom <URL: > if you need help
locating the package.

At least one user has recommended "Noweb" as a program for building
documentation into your Tcl application.  See
<URL: > for more

If you visit <URL: >, you will find
pointers to source and binary distributions (Linux, Windows, MacOS,
other) of PostScript viewing software, useful for viewing a variety of
PostScript versions of man pages, Tcl reference manuals, etc.
If you visit <URL: > you can find a number of binary
versions of acroread, which is a PDF viewer useful for some of the other
reference documents.

One Windows NT tool occasionally mentioned is the kill command found 
<URL: > .

This is another set of NT tools that includes a kill:
<URL: >.

User Contributions:

Report this comment as inappropriate
May 9, 2018 @ 10:10 am
Les infractions et crimes commis via Internet sont légion. Pour juguler cette cybercriminalité, une coopération internationale et la mobilisation de tous les acteurs sont requises. Les technologies de l'information et de la communication sont les moyens par lesquels les individus mal intentionnés utilisent pour arnaquer les citoyens. Dans le but de lutter activement contre la cybercriminalité, un Centre Européen de Lutte Contre la Cybercriminalité est mis en place par l’Union Européenne. La création de ce centre fait partie des mesures mises en place pour protéger les citoyens contre la criminalité à travers le réseau internet. Ses missions portent notamment sur les différents types de cybercriminalité à savoir escroqueries, fraudes, extorsions, abus, espionnages, arnaques aux sentiments, conflits et harcèlements. Ce centre inauguré depuis le 11 janvier 2013, situé dans les locaux d'Europol (office européen de police), à La Haye aux Pays-Bas a fait des prouesses considérables. En Décembre 2017 plus de 4 millions de personnes parmi ceux qui ont portées plaintes avec des preuves probantes et qui ont collaborées avec les éléments des brigades à l’arrestation des auteurs de ces crimes ont été remboursées et dédommagées, alors nous exhortons tous ceux qui se sont faits arnaqués via internet et qui détiennent des preuves à bien vouloir porter plainte aux adresses suivantes pour l’éradication de ce fléau.

Adresses mails : /

Comment about this article, ask questions, or add new information about this topic:


Top Document: comp.lang.tcl Frequently Asked Questions (Mar 05, 2005) (3/6)
Previous Document: -O- http files without a WWW client
Next Document: -Q- Source code from published books

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer: (Larry W. Virden)

Last Update March 27 2014 @ 02:12 PM