DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dspmsg(C)


dspmsg -- print message from message catalog

Syntax

dspmsg catalog [ -s set# ] msg# [ `default_message` [ argument ... ] ]

Description

dspmsg prints message number msg# from a message catalog on the standard output.

dspmsg looks for the named message catalog in the paths specified by the environment variable NLSPATH. If NLSPATH is not defined, dspmsg looks in the default message catalog directory.

The default set number set# used is 1; you can specify a different set number using the -s option.

You may specify a default message (default_message) that dspmsg must display if it cannot find the message specified by catalog, set#, and msg#. You should enclose the entire default message in single quotes.

dspmsg allows you to substitute up to 10 arguments into a message. You can use all the format conversion specifications allowed by printf(C) within messages. dspmsg replaces missing arguments with a default value (0, 0.0, or a null string depending on the conversion).

You must specify a default message if you wish to supply arguments.

Exit values

dspmsg returns the following values:

0
normal exit; no error

1
illegal argument supplied to the -s option; other incorrect usage of dspmsg

2
the message catalog cannot be opened and there is no default message

4
printf cannot be executed

Examples

You must specify a message catalog name and a message number to dspmsg. For example, to display message 12 from set 1 of message catalog kit.cat:

dspmsg kit.cat 12

The following displays message 9 from set 5 of message catalog top.cat; it displays no such message if the message cannot be found:

dspmsg top.cat -s 5 9 'no such message\n'

Using dspmsg with message catalogs allows you to modify the output from shell scripts without altering the shell script itself. For example, the following line from a shell script:

echo "Counted $count lines in file $filename"

could be replaced by:

dspmsg msg.cat 3 'Counted %1$d lines in file %2$s\n' $count $filename

where the default message will be used if message 3 cannot be found in the catalog msg.cat. See gencat(CP) for more information on creating message catalogs.

See also

gencat(CP), printf(C)

Standards conformance

dspmsg is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005