home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
os2
/
os2clu01.zip
/
UTILS.DOC
< prev
next >
Wrap
Text File
|
1993-07-04
|
31KB
|
1,045 lines
Documentation for OS/2 2.0 Command Line Utilities Page 1
Command Line Utilities Documentation -- 04th July 1993
Package Version 1.04 (Beta)
Package Copyright (c) 1993 Jonathan de Boyne Pollard
Licensed under General Public Licence version 1.00
Jonathan de Boyne Pollard, c/o 1 Queen's Close
KENILWORTH CV8 1JR, United Kingdom
Telephone +44 926 484514 (1000-1800 GMT)
This file is plain ANSI text with embedded tabs and form-feeds. It may be
viewed with an ANSI file viewer. This is preferable to printing it out,
because saving paper saves the environment.
To view : LIST UTILS.DOC (Vernon Buerg's file viewer)
To print : PRINT UTILS.DOC (MDOS and OS/2 print utility)
This file contains documentation for the command line utilities written
for OS/2 version 2.0 by Jonathan de Boyne Pollard. The DOS session
versions of the utilities have been tested under OS/2 2.0 VDM sessions,
MDOS 6.0 and DR-DOS 6.0.
Although I have taken great pains to ensure that these utilities are
problem-free (or at least, any known problems are thoroughly documented),
if you do find a problem with them, please contact me in writing at the
address given and I will attempt to cure it. Please provide BAT, CMD or
BTM files for complex command sequences, and state the make and version of
the operating system.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 2
What are the utilities ?
────────────────────────
The command line utilities are written to provide equal functionality in
OS/2 and DOS sessions under OS/2 version 2.0, and extend the functionality
of the bundled command processors.
Some features :
■ All utilities extend the normal DOS and OS/2 wildcards with a Bourne
shell like syntax, allowing for easy manipulation of specific groups of
files as a whole.
■ All utilities support the /? online help option.
■ All utilities will access the NLS message database for error messages
under OS/2 2.0 (e.g. "SYS0002: Fichier non-trouve." will be used in
France). Details of setting this up for VMB sessions as well are
available in the OPSYS.DOC document.
■ The option set is orthogonal. E.g. the /A and /S options are the same
for all utilities.
■ All utilities support NLS date and time, and automatically reformat
output for the current country specified in CONFIG.SYS.
■ Utilities with "pause" features will adjust to EGA and VGA 43 and 50
line modes.
■ All utilities support HPFS long filenames under OS/2.
These utilities were designed primarily for use under OS/2 2.0 in both
OS/2 and DOS sessions. Although they work under DR-DOS and MDOS, this is
not their primary purpose. Where OS/2 and DR-DOS or MDOS differ, OS/2 is
assumed.
The rest of this document
─────────────────────────
■ The utilities from all three discs are detailed in alphbetical order;
■ Then there is a note on extended wildcards;
■ After that, the "standard" command line options are listed;
■ And finally the credits.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 3
The utilities
─────────────
ATTRIB [/Help] [/Options[-|+]] [-|+[ndvRASH]] Filespecs ...
■ ATTRIB supports the /A /D /L /N /P /R /S /V /Y standard options ■
The ATTRIB command allows file attributes to be changed, exactly as the
DOS ATTRIB command does. However, it supports extended wildcards, can
act upon subdirectories, and allows multiple operations upon files.
Attributes may be turned on and off using '+letter' and '-letter'
between filenames (which is why options may not be preceded by '-' for
this command). Attributes are incremental along the command line, e.g.
ATTRIB -H *.HID -S *.SYS +R *.EXE
will remove the Hidden attribute from *.HID files, remove the Hidden
AND System attributes from *.SYS files, and remove both and add the
ReadOnly attribute to *.EXE files.
On Novell networks in DOS sessions, the -N and +N attributes will
enable and disable the Netware "shareable" attribute.
CMOS [/Help] [/All] [/dsex]
The CMOS command displays the contents of CMOS RAM on AT and above
class machines. The /D(ate), /S(tatus), /E(quipment), and /X(hex)
toggle options enable display of specific information.
Under OS/2 2.0 you must either have IOPL=YES or IOPL=CMOS in your
CONFIG.SYS file to enable the program to access the CMOS RAM.
Because it cannot easily do so under OS/2, CMOS does not check the BIOS
to ansure that it is run on an AT class machine, or to obtain the drive
table. Drive types are encoded into CMOS.EXE.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 4
COM2EXE [/Help] InFile[.com] [OutFile[.exe]]
EXE2COM [/Help] InFile[.exe] [OutFile[.com]]
EXE2COM is a version of the EXE2BIN program that comes supplied with
MDOS 3.x and DR-DOS 6.0, which is not supplied with OS/2 2.0, MDOS 5.0
or MDOS 6.0.
EXE2COM's operation is based upon the DR-DOS variant of the EXE2BIN
command, in that a COM or BIN extension is chosen based upon the
initial value of IP in the EXE header record, and program output
closely mimics DR-DOS' EXE2BIN.
COM2EXE is used to convert COM format files to EXE files. Early
versions of CodeView and other debuggers would not load COM files
correctly, and COM2EXE can be used to create an EXE format file that
can be debugged.
Because they are compressed, DR-DOS 6.0 contains all DOS commands in
EXE format, despite the COM extension of some commands. Similarly, MDOS
6.0 contains some COM files which are really EXE files with the wrong
extension. Both EXE2COM and COM2EXE will check the header record of a
file for the 'MZ' signature before conversion and act accordingly.
OS/2 2.0 supplies most commands as "dual mode" commands, using the "New
EXE" format. EXE2COM and COM2EXE will refuse to operate on these
programs.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 5
DUMP [/Help] [/Options[+|-]] Filespecs ...
■ DUMP supports the /A /S standard options ■
DUMP is a file content display program, which recognises files
according to their extensions and attempts to display them accordingly.
EXE and COM programs will have their initial 'MZ' header record
displayed, if available, showing the size of the program and various
loading parameters. DUMP will recognise EXE format programs that have
been converted from COM programs using COM2EXE or PKLITE.
LIB and OBJ files will be have their Intel OMF records displayed. DUMP
recognises several of the Borland and Microsoft OMF additions, such as
Borland AutoMAKE records, and display them accordingly.
ARC, ARJ, LZH, ZIP, and ZOO files will have their archive contents
displayed. In addition, ZIP files will have their ZIP archive comment
displayed.
■ Note ■
Until an OS/2 version of Vernon Buerg's FV file viewer is widely
available, you may copy DUMP.EXE to FV.EXE, allowing you to operate the
Archive [V]iew option in Vernon Buerg's LISTOS2.
Users of 4OS2 may use the easier ALIAS FV=DUMP .
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 6
FF [/Help] [/Options[+|-]] Pathspecs ...
■ FF supports the /L /P standard options ■
FF is a File Finder program for use under OS/2 2.0 that will locate
files in subdirectories and within archives. It supports the following
toggle options :
/ARC Search inside ARC format archives;
/ARJ Search inside ARJ format archives (not multi-volume);
/LZH Search inside LZH format archives;
/PAK Search inside PZK format archives;
/ZIP Search inside ZIP format archives (not multi-volume);
/ZOO Search inside ZOO format archives;
/DIR Search the normal DOS directory (enabled by default).
The /N option may be used to disable all archive searching options
(normally all archive types apart from ARC and PAK will be searched)
for a faster search.
The /R option forces the search to start from the root directory.
Normally the search starts from the directory specified in the path
specification (the current directory by default). This is because
starting from the root directory is less than useful on networks.
The /D option (normally off) enables a "progress display" of the
current archive or directory being searched. In an OS/2 windowed
session this can significantly slow down the search.
The /T option disables output of filenames, and displays the total
number of files found, and the total number found in each archive type
(if any) along with the total sizes in each category.
The /V option (normally on) enables display of attribute and datestamp
information along with each file. Because of FF's simple approach to
ZIP archives, no attribute information is available when displaying
files found therein.
The /W(ide) option in combination with /V- disables output of attribute
and datestamp information for each file, displaying filenames in a
columnar format.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 7
KEYLOCKS [/Help] [/Options[-|+]]
KEYLOCKS alters the state of the keyboard shift locks (CAPS, NUM, and
SCROLL). The /C(aps), /N(um) and /S(croll) options will either toggle
the existing status, or will force the appropriate lock on if
followed by + or off if followed by -.
KEYLOCKS works in full screen VDM, VMB, or OS/2 sessions. It does not
work in sessions that are windowed on the desktop.
LINES [/Help] [/Options[-|+]] ROWS [COLS]
LINES changes the screen size of a text mode or windowed OS/2 or DOS
session. The /C and /M options force use of a colour or monochrome
mode, otherwise the current setting is retained if possible.
Unlike the MODE command, LINES will not clear the screen when changing
screen size, and will attempt to keep the current cursor position.
The /V option to lines will cause it to display (after changing mode)
the display mode and adapter that were previously in operation.
LINES supports 5 to 102 line modes in an OS/2 windowed session.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 8
MEM [/Help] [/Options[-|+]]
■ MEM is available as a DOS tool only. ■
MEM displays the DOS memory map and some useful information for
checking which memory managers are loaded and what types of memory are
available.
MEM will detect XMS and DPMI and display information about them,
including the amound of UMB memory available from ther XMS driver, the
XMS entry point, the DPMI entry point, the DPMI server version number;
whether it is a 16-bit or 32-bit server; and the CPU that the DPMI
server is supporting.
MEM will display in order
a full memory map of DOS memory from 0000:0000 to FFFF:FFFF,
including all device drivers, system areas, and the XMS and DPMI
entry points if available
a summary of available memory;
the DOS version number and HMA loading information;
and any DPMI server information.
The /S(ystem) option enables inclusion of system areas and information
in the display. The /D(rivers) option enables display of loaded device
drivers, including their attribute words. The /M(ap) option displays
the summary map of available memory.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 9
MOREANSI [/Help] [/Options[+|-]] Filespecs ...
MOREANSI is a simple rewrite of the MORE command that is able to
display ANSI files created by ANSI screen generators like TheDraw
in a more intelligent fashion.
MOREANSI will attempt to pause before every clear screen, and every
time a screenfull of text has scrolled by. It attempts to do the
latter by counting CRLFs, and discounting the dummy CRLF sequences
that screen generators have to insert in order to overcome
line-wrap problems.
MOREANSI is useful as an external ANSI file viewer in mail readers
that do not directly support ANSI internally (such as MegaMail),
and is part of the forthcoming MishMugs QWK mail reader for OS/2
2.1.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 10
PROFF [/Help] [/atf] [/v(stv)] Files ...
PROFF is a simple text formatter for displaying ProText documents on
the screen. ANSI screen codes wust be enabled for PROFF to work
properly.
For an example of a PROFF document, see the UTILS.1 document from which
UTILS.DOC was constructed. Very much like a poor man's NROFF, PROFF
allows files to be created with a simple text editor (ProText was not
used to create the UTILS.1 file !) and them formatted with headers,
footers, tabulation and margins.
TOUCH [/Help] [/Options[-|+]] Filespecs ...
■ TOUCH supports the /A /D /L /N /P /R /S /V /Y standard options ■
TOUCH allows the "last modified" datestamps of files to be changed.
Based upon the command syntax of DR-DOS' TOUCH, it not only defaults to
updating files to today's date, but can be given a specific date and
time to use.
The /D option must be followed by a date string in the format
appropriate to the country set by COUNTRY= in your CONFIG.SYS file.
Similary the /T option must be followed by a (24 hour) time string in
your local time format.
E.g. for United Kingdom users the following formats are required :
OS/2 2.0 DD-MM-YY HH:MM:SS
MDOS 6.0 DD/MM/YY HH:MM:SS
DR-DOS 6.0 DD-MM-YY HH:MM:SS
Users in other countries should consult the output of their DATE and
TIME commands.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 11
WC [/Help] [/!] [/Options[-|+]] Filespecs ...
■ WC supports the /A /L /S standard options ■
WC is a word counting program which will count and display the number
of lines, words, letters, characters, and bytes in the files specified
on the command line, or from the standard input if no files are given.
WC fully supports extended wildcards and subdirectory searches. The '-'
filename instructs WC to count the standard input in a list of files.
WC will normally split words at any character that is not a letter
character. The /H option when enabled stops hyphens splitting words.
Similary the /U option when enabled stops punctuation from splitting
words.
The /C option when enabled stops control characters from being counted
as characters. Blank spaces or Tabs do not count as characters.
WHAT [/Help] [/Options[-|+]] Filespecs ...
■ WHAT supports the /A /L /S standard options ■
The WHAT command searches for identity strings in files This is an
amalgam of various file identification programs.
The /N option enables the display of identification strings found in
Novell programs. These are strings preceded by the VeRsIoN= tag.
The /U option enables the display of identification strings generated
by SCCS systems. This is the @(#) tag.
The /T option enables the display of the strings created by SCCS
variant used by Tandon corporation in their DOS. This is the @[#] tag.
The /G option enables the display of strings enclosed in double braces,
e.g. {{ My File 01 Jan 93 by me }}.
The /C option will perform a CRC-16 of each file as it is scanned, and
print the result in hexadecimal.
All of the utilities included in this package have an SCCS tag.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 12
WHICH [/Help] [/e PATHENV] Program
WHICH determines what command would be executed were it to be typed at
the command line. It searches the PATH environment variable (although
the /E option can denote another variable) for the command, using the
COM, EXE, BAT, BTM, and CMD extensions if none are supplied.
WHICH is also aware of commands built in to various command processors
(COMMAND.COM and CMD.EXE) and will indicate internal commands.
Like 4DOS and 4OS2 (J.P. SOFTWARE's command interpreters), WHICH will
search the current directory first only if it is not already mentioned
in the PATH. Also WHICH supports 4DOS and 4OS2 "executable extensions"
and will indicate any found.
Note that because WHICH supports extended wildcards, it is useful for
full utility directories :
WHICH *BOOT* "How many boot utilities do I have ?"
WHICH *FF* "Show me all of the File Finders ..."
Also which can be used to locate library or help files :
WHICH /E HELPFILES *.HLP
WHICH /E LIB *87*.LIB
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 13
XDEL [/Help] [/Options[-|+]] Filespecs ...
■ XDEL supports the /A /D /L /N /P /R /S /V /Y standard options ■
XDEL is an extension of the DEL command, based (again) on the syntax of
DR-DOS' XDEL command. It supports subdirectory searches and extended
wildcards.
The /Z(ap) option to XDEL forces files to be overwritten with zeros
before deletion, making recovery with an UNDELETE utililty rather
pointless.
The /D(irectory) option to XDEL will remove empty subdirectories when
performing a recursive delete.
XDIR [/Help] [/Options[+|-]] Filespecs ...
■ XDIR supports the /A /D /L /N /O /P /R /S /V /Y standard options ■
XDIR is an extension of the DIR command, based (once more) on the
syntax of DR-DOS' XDIR command. It supports subdirectory searches and
extended wildcards.
Note that, unlike other DIR and XDIR commands, this XDIR can be told to
display either of the creation or last access datestamps instead of the
last modification timestamp under OS/2 2.0, and will sort on the
datestamp selected.
Normally XDIR will scan all filenames into memory and display a sorted
list. Where there are too many filenames, or scanning is slow and
sorting undesirable, the /N option will display filenames as they are
scanned, and not read them into memory.
The sorting options are as for MDOS 5.0 and OS/2 2.0, with the addition
of Y (which is currently unused). Note that the G (file type) sorting
option sorts files into Directories > Executables > Other files.
The /B option disables full output of attributes and file datestamps.
The /F option enables display of the full pathname of files found. If
it is disabled, then only the 13 character base file name is displayed.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 14
Wildcards
─────────
Wildcards on the command line may be used as follows :
* matches zero or more characters, including full stops '.';
? matches a single character, including a full stop '.';
[abc] ranges delimited with brackets match one character included in
the range;
{,} braces denote a list of comma-separated strings, any one of which
may match that part of the filename;
. matches either another full stop '.' or the end of the filename;
Any other character matches that character alone.
Under OS/2 2.0 (both real and protected mode sessions) and on networked
drives with Novell Netware, the behaviour of the '*' wildcard is the same
as for the UNIX Bourne shell, in that '*abc*' will match names with 'abc'
contained anywhere in them. Under other DOSes, this is not so, and the
utilities will attempt to correct for this if they fail to detect OS/2
2.0.
This may cause performance problems under other other DOSes. For instance,
suppose a directory containing 300 files, 30 of which end in 's'. Under
OS/2 2.0, the operating system will return only 30 file names for the
utility to process, whereas under another DOS, all 300 will be returned,
and the utility will have to select those ending in 's' itself.
Some wildcard examples :
* All files.
*.* All files (for compatibility with DOS).
*. All files without an extension.
*.{exe,com,bat} All executable and batch files.
[abc]* All files beginning with A, B, or C.
[^abc]* All files not beginning with A, B, or C.
*b* All files with B in their name, including
in the extension.
*b*.* All files with B in the name.
???.* All 3 letter files (any extension).
*.? All files with a single extension letter.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 15
Command line options
────────────────────
All utilities support command line options in the same way :
/? The help screen is displayed (with any options
/Help preceding on the command line in effect), and the
utility terminated.
/S+ A toggle option followed by '+' will turn it on.
/S- A toggle option followed by '-' will turn it off.
/S A toggle option on its own will reverse the value.
/P+S+Y+ Options may be combined after a single '/'.
-S+ Options may also follow '-' for UNIX diehards, except
in the ATTRIB command.
All options are processed before any filenames, whatever the order is
on the command line.
To disable misinterpretation of filenames beginning with '/', the '//'
string will disable further option processing.
(Similary to disable misinterpretation of filenames beginning with
'-', the '--' string will disable further option processing.)
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 16
Some "standard" option letters
──────────────────────────────
/A The /A option allows inclusion of files by their attributes.
'+' followed by an attribute letter will include files with that
attribute. '-' followed by a letter will exclude files. An attribute
letter on its own will force ONLY files with that attribute to be
processed. The attributes are :
N(etShare), D(irectory), V(olume label)
R(ead only), A(rchive), S(ystem), H(idden).
/D The /D option enables operation on directories where this is
meaningful. For instance, XDEL will delete empty subdirectories if
this is enabled.
/L The /L option indicates that filenames should be converted to
lowercase.
/N This stops actual execution of commands that change files (such as
XDEL, TOUCH, or ATTRIB), but produces output as if the command had
executed. This is useful for finding out what a command would do.
/O This allows ordering of the XDIR command. The first letter is the
primary sorting order, and following letters refine the sort.
Preceding a letter by '-' reverses the order. For symmetry '+' may
precede a letter to indicate ascending order, which is the default.
The order letters are :
N(ame), E(xtension), D(ate and time),
S(ize), Y(*nothing*), G(file type)
(When sorting by file type, directories are first, followed by EXE
and COM executable files, then BAT, COM and BTM batch files, and
lastly any other files.)
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 17
/P The /P option has two meanings.
For commands that change files (XDEL, TOUCH, or ATTRIB), this
disables the global prompt, and enables Yes/No prompting for
individual files. The action to be taken is displayed; pressing 'Y'
will perform the action, and 'N' will skip the file and proceed to
the next.
For informational commands (WC, WHAT, XDIR, or FF), this causes a
prompt to be displayed at every screen full of output (or as near as
can be calculated to a screen full). Pressing [Return] will continue
for another screen, [Esc] will terminate the program, [Space] will
display another file, or [C] will enable continuous output. If
continuous output is enabled, or pausing is disabled, then pressing
[Space] will turn pausing on again.
/R The /R option enables overriding of READ-ONLY files for XDEL and
TOUCH. Otherwise, read-only files will be skipped. On networks you
must have permission to change file attributes if the /R option is to
be used successfully.
/S The /S option enables recursion into subdirectories.
/V The /V is normally on, and enables output. For use in batch files /V-
(along with /Y+) can disable output of individual file names, and
will just display the total number of files processed.
/Y The /Y (Yes) option disables the global prompt in XDEL, TOUCH, and
ATTRIB. If /Y- is used, then for each filespec on the command line
you will be prompted as to whether you wish to perform the specified
action on the files named.
You will be reminded at the global prompt if /S, /R, or /D options
are also in effect.
Copyright (c) 1993 JdeBP
Documentation for OS/2 2.0 Command Line Utilities Page 18
Warranty and Licence
────────────────────
For warranty and licence conditions, see the file COPYING, which
contains my General Public Licence. These utilities are issued under the
terms of "NON-CHARGEABLE SOFTWARE".
Although I am not demanding payment for use of these utilities, if you
find them useful (or if you send in a wish list), I hope that you feel
morally obliged to send a small (£10) donation (no foreign cheques please)
to finance their continuing development.
All contributions are presently going toward purchase of IBM's OS/2 2.0
Programmers Refence Documentation (lots of expensive Big Blue Books!) and
CSet/2, in order that further enhancements may support other OS/2 2.0
goodies.
Credits
───────
The utilities were written using Borland C++ for DOS version 3.0 and a
custom version of a POSIX.1 compliant ANSI C library that works in real
and 16-bit protected mode (also supporting 16-bit Family API applications)
written by the author.
The utilities were originally written to test the operation of that
library, but the author's colleagues found them so useful that he has
inflicted them on the outside world. This is why the version numbers of
some of the utilities are so high.
The library will be available early June 1993 "on all good BBSes" in
object form as shareware. Full source licences will be available if anyone
is interested.
Many thanks to Russell Freeman, and to Philip Wray for his "intelligent
monkey" method of program testing.
Upgrades to the Utilities
─────────────────────────
Major enhancements or fixes for major bugs will be posted as new
versions of the utility package on The IBM OS/2 BBS and Mission Impossible
BBS in the United Kingdom.
Copyright (c) 1993 JdeBP