|
|
Microsoft OS/2 SDK 12-15-1987
Name
shd - Displays named shared memory segments or files in hexadecimal
format. Works in both protected mode and real mode with real mode
only allowing file examination.
Syntax
shd [-format] [-mode] [-s offset] [-n count] [name]...
Description
The shd command displays the contents of named shared memory segments or
files in hexadecimal, octal, decimal, and character formats. Control
over the specification of ranges of characters is also available.
The default behavior is with the following flags set: "-abx -A". This
says that address (shared memory or file offsets) and bytes are printed
in hexadecimal and that characters are also printed.
If no 'name' argument is given, the standard input is read. If one or
more names are given, shd first checks to see if 'name' is a valid shared
memory segment. If a shared memory segment does not exist, then shd
checks for a file with that name. In either case once a valid shared
segment or file has been found, all other names on the command line are
treated in the same manner as the first.
Options include:
-s offset
Specify the beginning offset in the memory segment or file where
printing is to begin. If no memory segment or file argument is
given, or if a seek fails because the input is a pipe, 'offset' bytes
are read from the input and discarded. Otherwise, a seek error will
terminate processing of the current memory segment or file.
The offset may be given in decimal, hexadecimal (preceded by '0x'),
or octal (preceded by '0'). It is optionally followed by one of the
following multipliers: w, l, b, k; for words (2 bytes), long words (4
bytes), blocks (512 bytes), or K bytes (1024 bytes). Note that this
is the one case where "b" does not stand for bytes. Since specifying
a hexadecimal offset in blocks would result in an ambiguous trailing '
b', any offset and multiplier may be separated by an asterisk (*).
-n count
Specify the number of bytes to process. The count is in the same
format as offset, above.
Mode Flags
The mode flags may be used to override the default of checking first
for a named shared segment and then for a file that matches the
first 'name' argument.
-m
Sets the mode to named shared memory segments and causes the
program to look only for a named shared memory segment and if not
found, will not look for a file by the name and will announce
that it was not found.
-f
Sets the mode to files and cause the program to look only for a
file and if not found will announce that it was not found.
Format Flags
Format flags may specify addresses, characters, bytes, words (2
bytes), or longs (4 bytes) to be printed in hexadecimal, decimal or
octal. Two special formats may also be indicated: text or ASCII.
Format and base specifiers may be freely combined and repeated as
desired in order to specify different bases (hexadecimal, decimal or
octal) for different output formats (addresses, characters, etc.).
All format flags appearing in a single argument are applied as
appropriate to all other flags in that argument.
acbwlA
Output format specifiers for addresses, characters, bytes, words,
longs and ASCII, respectively. Only one base spec will be used
for addresses; the address will appear on the first line of
output that begins each new offset in the input.
The character format prints printable characters unchanged,
special C escapes as defined in the language, and remaining
values in the specified base.
The ASCII format prints all printable characters unchanged, and
all others as a period (.). This format appears to the right of
the first of other specified output formats. A base spec has no
meaning with the ASCII format. If no other output form at (other
than address) is given, bx is assumed. If no base spec is given,
all of xdo are used.
xdo
Output base specifiers for hexadecimal, decimal and octal. If no
format spec is given, all of acbwl are used.
t
Print a text file, each line preceded by the address in the file.
Normally, lines should be terminated by a \n character; but long
lines will be broken up. Control characters in the range 0x00 to
0x1f are printed as '^@' to '^_'. Bytes with the high bit set
are preceded by a tilde (~) and printed as if the high bit were
not set. The special characters (^, ~, \) are preceded by a
backslash (\) to escape their special meaning. As special cases,
two values are represented numerically as '\177 ' and '\377'.
This flag will override all output format specifiers except
addresses.
Names
More than one name may be specified in the 'name' argument. There are
two formats expected depending on the mode of use.
Memory Mode
The names listed on the command line must not include the "SHAREMEM\"
part of the named shared memory segment. If you want to examine a
named shared memory segment it would normally be addressed as:
"\SHAREMEM\name.ext" using the standard file naming conventions. This
program automatically appends the "\SHAREMEM\" portion of the named
shared memory segment and requires that the name argument only
include the "name.ext" portion of the named shared memory
specification. It will not find the segment if the entire shared
memory path is used.
File Mode
The names listed on the command line may follow the standard file
naming conventions with complete path specification as desired.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.