sortm Command

Purpose

Sorts messages.

Syntax

sortm [ +Folder ] [ Messages ] [ -datefield Field ] [ -noverbose | -verbose ]

Description

The sortm command sorts messages according to their Date: field and renumbers them consecutively beginning with number one. Messages that are in the folder, but not specified to be sorted, are placed after the sorted messages. The sortm command displays a message if it cannot parse a date field.

To specify a field other than the Date: field, specify the -datefield flag. If you specify a folder, it becomes the current folder. The current message remains the current message for the specified folder, even if it moves during the sort.

Flags

Item Description
-datefield Field Specifies the header field to be used in the sort. The Date: field is the default.
+Folder Specifies the folder with messages to be sorted. The default is the current folder.
-help Lists the command syntax, available switches (toggles), and version information.

Note: For Message Handler (MH), the name of this flag must be fully spelled out.

Messages Specifies the messages to be sorted. Use the following references to specify messages:
Number
Number of the message.
Sequence
A group of messages specified by the user. Recognized values are:
all
All messages in a folder. This is the default.
cur or . (period)
Current message.
first
First message in a folder.
last
Last message in a folder.
next
Message following the current message.
prev
Message preceding the current message.
-noverbose Prevents display of information during the sort. This flag is the default.
-verbose Displays information during the sort. This information allows you to monitor the steps involved.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Profile Entries

The following entries are found in the UserMhDirectory/.mh_profile file:

Item Description
Current-Folder: Sets the default current folder.
Path: Specifies the UserMhDirectory.

Examples

  1. To sort all the messages in the current folder according to the date, enter:
    sortm
  2. To sort messages 5 through 10 in the easter folder according to the date, enter:
    sortm  +easter 5-10

Files

Item Description
$HOME/.mh_profile Contains the MH user profile.
/usr/bin/sortm Contains the sortm command.