QMSG(1POSIX)
πΈ PROLOG πΈ
okay bestie, real talk before we get into it: this page is part of the POSIX Programmer's Manual. The Linux implementation of this interface might be different (so go check the corresponding Linux manual page for the deets on Linux behavior), or it might not be implemented on Linux at all. π Not every system is gonna have this one, iykyk.
β¨ NAME β¨
qmsg β send message to batch jobs
π SYNOPSIS π
qmsg [-EO] message_string job_identifier...
π DESCRIPTION π
Okay so, sending a message to a batch job means asking a server to write a message string into one or more output files of that batch job. The message gets sent to a batch job by making a request to the batch server that manages the batch job. And qmsg? qmsg is a user-accessible batch client that requests the sending of messages to one or more batch jobs. That's the whole gig. π«Ά
Here's the important part, and honestly it's giving "middleman who refuses to do the job themselves": qmsg writes messages into the files of batch jobs by sending a Job Message Request to the batch server that manages the batch job. It shall not directly write the message into the files of the batch job. It just asks. Politely. Via the server. π
qmsg shall send a Job Message Request for those batch jobs, and only those batch jobs, for which a batch job_identifier is presented to the utility. No sneaky extras, no surprise jobs. π
And the order matters: qmsg shall send Job Message Requests for batch jobs in the order in which their batch job_identifiers are presented to the utility. First one you typed, first one it handles. Periodt.
If qmsg fails to process any batch job_identifier successfully, it shall keep going and process the remaining batch job_identifiers, if any. It does not give up on the whole list because one of them flopped. Resilient queen. π
Also: qmsg shall not exit before a Job Message Request has been sent to the server that manages the batch job corresponding to each successfully processed batch job_identifier. It waits. It's committed. π
β OPTIONS β
qmsg shall conform to the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines. (Yes, that's a real citation, go look it up bestie.)
The following options shall be supported by the implementation:
-Eβ Specify that the message is written to the standard error of each batch job.qmsgshall write the message into the standard error of the batch job.
-Oβ Specify that the message is written to the standard output of each batch job.qmsgshall write the message into the standard output of the batch job.
Now, if neither the -O nor the -E option is presented to qmsg, the utility shall write the message into an implementation-defined file. The conformance document for the implementation shall describe the name and location of that implementation-defined file. So like, where it goes is a mystery unless you read the docs. π
But if both the -O and the -E options are presented? Then the utility shall write the messages to both standard output and standard error. Both. Why choose one when you can have both, honestly. π¦
π OPERANDS π
qmsg shall accept a minimum of two operands: message_string and one or more batch job_identifiers.
The message_string operand shall be the string to be written to one or more output files of the batch job, followed by a <newline>. If the string contains <blank> characters, then the application shall ensure that the string is quoted. (Yes, quote it. The shell will absolutely eat your words otherwise, and then you'll be sad. π) The message_string shall be encoded in the portable character set (see the Base Definitions volume of POSIX.1β2017, Section 6.1, Portable Character Set).
All the remaining operands are batch job_identifiers that conform to the syntax for a batch job_identifier (see Section 3.3.1, Batch Job Identifier).
π STDIN π
Not used. She doesn't read from stdin, bestie. Not her thing. π
πΈ INPUT FILES πΈ
None. Zero. Nada.
π ENVIRONMENT VARIABLES π
The following environment variables shall affect the execution of qmsg:
LANGβ Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ If set to a non-empty string value, override the values of all the other internationalization variables.LC_CTYPEβ Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.LOGNAMEβ Determine the login name of the user.
π§ ASYNCHRONOUS EVENTS π§
Default. Nothing special here, it's giving chill.
β¨ STDOUT β¨
None.
π STDERR π
The standard error shall be used only for diagnostic messages. It's not a hangout spot, it's a work channel.
π OUTPUT FILES π
None.
π EXTENDED DESCRIPTION π
None.
π¦ EXIT STATUS π¦
The following exit values shall be returned:
0β Successful completion. Slay. β¨>0β An error occurred. π
π CONSEQUENCES OF ERRORS π
In addition to the default behavior, qmsg shall not be required to write a diagnostic message to standard error when the error reply received from a batch server indicates that the batch job_identifier does not exist on the server. So like β job's not there, she might just... not mention it. It's giving "no thoughts, head empty."
Whether or not qmsg waits to output the diagnostic message while attempting to locate the job on other servers is implementation-defined. So that timing is entirely up to whoever built it. π
The following sections are informative.
πΈ APPLICATION USAGE πΈ
None.
π EXAMPLES π
None. (Yeah, I know. No example. We're all a little disappointed. π)
β RATIONALE β
qmsg lets users write messages into the output files of running jobs. Users β including operators and administrators β have a number of occasions when they want to place messages in the output files of a batch job. For example, if a disk that is being used by a batch job is showing errors, the operator might note this in the standard error stream of the batch job. See? Useful. Communication with your future self who reads the logs. π«Ά
The options of qmsg give users the means of placing the message in the output stream of their choice. The default output stream for the message β if the user does not designate an output stream β is implementation-defined, since many implementations will provide, as an extension to this volume of POSIX.1β2017, a log file that shows the history of utility execution. So the "default" might secretly be a log file. Mystery behavior, but make it documented. β¨
If users wish to send a message to a set of jobs that meet a selection criteria, the qselect utility can be used to acquire the appropriate list of job identifiers. (Friend of the show, we'll link her below. π)
The -E option allows users to place the message in the standard error stream of the batch job.
The -O option allows users to place the message in the standard output stream of the batch job.
Historically, qmsg is an existing practice in the offerings of one or more implementors of an NQS-derived batch system. The utility has been found to be useful enough that it deserves to be included in this volume of POSIX.1β2017. Certified useful. Iconic behavior. π
π₯ FUTURE DIRECTIONS π₯
qmsg may be removed in a future version. So like... enjoy her while she's here, bestie. π
π«Ά SEE ALSO π«Ά
- Chapter 3, Batch Environment Services,
qselect - The Base Definitions volume of POSIX.1β2017, Section 6.1, Portable Character Set, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! π this was IEEE/The Open Group's 2017 edition, qmsg(1POSIX), and yes the footer really does say 2017 β we love a vintage queen. now go send some messages to your batch jobs and slay β¨π
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms