SHMCAT(1)SHMCAT(1)NAMEshmcat - dump shared memory segments, files, standard input and/or text
SYNOPSISshmcat [ OPTION ]... [ OPERAND ]...
DESCRIPTION
Dump shared memory segments, files, standard input and/or text to stan‐
dard output. If no OPERAND is given, read standard input only. If more
than one OPERAND is given, dump them in order. If some of the OPERANDs
cannot be read, shmcat prints an error message to standard error and
tries to continue with the other OPERANDs.
Most modern systems support two APIs for shared memory:
The older one is commonly known as the System V API. It uses numeric
keys and IDs as identifiers and consists of system calls like
shmget(2), shmat(2) and shmdt(2).
The newer API is called the POSIX shared memory API. It uses names in
string form as identifiers. It treats shared memory similar to files,
which are opened with shm_open(3) and then mapped into the program
address space via mmap(2). Please note that POSIX shared memory is not
supported by all versions of shmcat.
If shmcat has been compiled without getopt_long(3) support, only the
short, one character OPTIONs and OPERANDs can be used. Otherwise the
long ones are also available. When a long OPTION or OPERAND needs an
argument, the short versions do so, as well.
OPTIONS-h, -?, --help
Display usage information and quit without dumping anything.
-V, --version
Show version information and quit without further action.
OPERANDS-f, --file=FILENAME
Dump the contents of the given file.
-i, --stdin
Dump standard input.
-M, --shmkey=KEY
Dump the System V shared memory segment with the given key. The
key can be given as a decimal (no prefix), octal (prefix 0), or
hexadecimal (prefix 0x) number. It can, for example, be obtained
using the ipcs(1) or the ftok(1) tool.
-m, --shmid=ID
Dump the System V shared memory segment with the given id. The
id can be given as a decimal (no prefix), octal (prefix 0), or
hexadecimal (prefix 0x) number. It can, for example, be obtained
using the ipcs(1) tool.
-n, --newline
Add a line feed.
-p, --posix-shm=NAME
Dump the POSIX shared memory segment with the given name (not
supported in all installations).
-t, --text=TEXT
Print the given text.
EXIT CODES
0 No errors, every OPERAND requested was dumped
1 There was an error while dumping at least one OPERAND, but the
program continued with the other OPERANDs (if given)
2 There was a fatal error, usually this means that shmcat could
not write to standard output
10 Wrong usage of the program
NOTES
Usually, when you dump shared memory segments, you should redirect the
output of shmcat to a file or a program like od(1), because shared mem‐
ory data usually has a binary form and thus it may contain non-print‐
able characters. You also probably want to suspend the processes writ‐
ing to the shared memory object in order to get a consistent dump.
AUTHOR
Stefan Gast
SEE ALSOftok(1), ipcs(1), shmat(2), shmget(2), shm_open(3)shmcat(1) November 2012 SHMCAT(1)