print.runmailcap
Execute commands defined in mailcap files
TLDR
Print action can be used to print any file on default run-mailcap tool
With run-mailcap
SYNOPSIS
print.runmailcap [-n] [-v] [-t] [-q] [-p] [-d] [-m file] [content-type]
PARAMETERS
-n
Disable printing of newlines after each command.
-v
Verbose mode: display more information about the mailcap entry being used.
-t
Test mode: check the syntax of the mailcap file without actually running any commands.
-q
Quiet mode: suppress error messages.
-p
Pretty print: produce easily readable output.
-d
Debug mode: display debugging information.
-m file
Specify an alternate mailcap file to use instead of the default. Often ~/.mailcap is the default. Default /etc/mailcap or /usr/etc/mailcap.
content-type
The MIME type to look up in the mailcap file (e.g., text/plain, image/jpeg).
DESCRIPTION
The print.runmailcap command is a utility that extracts and prints commands associated with a specified MIME type from the mailcap (mail capability) file. This file typically contains mappings between MIME types and the programs or scripts used to handle them. It is designed to provide a way to determine how to process or display files of different types based on their declared MIME type. It reads the mailcap file, looks for an entry that matches the content type, and then prints the command associated with it to standard output.
It's important to note that print.runmailcap primarily focuses on *printing* the command, not executing it. It is more of a lookup tool than a direct execution tool. The output command can then be used in scripts or other programs for further processing.
The primary use case is for determining the appropriate command for viewing or handling different file types. If no matching entry is found in the mailcap file, nothing is printed.
MAILCAP FILES
Mailcap files define how different MIME types are handled by applications. Each entry in the mailcap file typically includes a MIME type, a command to execute, and optional flags. print.runmailcap reads these entries to determine the appropriate command for a given MIME type.
EXIT STATUS
The print.runmailcap command returns 0 on success, and a non-zero value on failure (e.g., if the specified MIME type is not found in the mailcap file or if an error occurs during processing).
SEE ALSO
runmailcap(1)