[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 4

pick Command

Purpose

Selects messages by content and creates and modifies sequences.

Syntax

pick [ +Folder ] [ Messages ] [ -datefield Field ] [ -not ] [ -lbrace ] [ -after Date ] [ -before Date ] [ -cc "Pattern" ] [ -date "Pattern" ] [ -from "Pattern" ] [ -search "Pattern" ] [ -to"Pattern"] [ --Component "Pattern" ] [ -rbrace ] [ -and ] [ -or ] [ -sequence Name [ -zero | -nozero ] [ -public | -nopublic ] [ -list | -nolist ]

Description

The pick command selects messages containing particular character patterns or particular dates. You can use the -and, -or, -not, -lbrace, and -rbrace flags to construct compound conditions for selecting messages.

Flags

-after Date Selects messages with dates later than that specified by the Date variable. Use the following specifications for the Date variable:
yesterday        today           tomorrow
sunday           monday          tuesday
wednesday        thursday         friday
saturday         -Days           SystemDate

The pick command treats the days of the week as days in the past. For example, monday means last Monday, not today or next Monday. You can use the -Days argument to specify a number of days in the past. For example, -31 means 31 days ago. For the SystemDate argument, you can specify any valid format defined for your system.

-and Forms a logical AND operation between two message-selecting flags; for example, pick -after Sunday -and -from mark. The -and flag has precedence over the -or flag, but the -not flag has precedence over the -and flag. Use the -lbrace and -rbrace flags to override this precedence.
-before Date Selects messages with dates earlier than the specified date. See the -after flag on how to specify Date.
-cc "Pattern" Selects messages that contain the character string specified by the "Pattern" variable in the cc: field.
-date "Pattern" Selects messages that contain the character string specified by the "Pattern" variable in the Date: field.
-datefield Field Specifies which dated field is parsed when the -after and -before flags are given. By default, the pick command uses the Date: field.
+Folder Identifies the folder that contains the messages you wish to pick. By default, the system uses the current folder.
-from "Pattern" Selects messages that contain the character string specified by the "Pattern" variable in the From: field.
-help Lists the command syntax, available switches (toggles), and version information.
Note: For MH, the name of this flag must be fully spelled out.
-lbrace Groups -and, -or, and -not operations. Operations between the -lbrace and -rbrace flags are evaluated as one operation. You can nest the -lbrace and -rbrace flags.
-list Sends a list of selected message numbers to standard output. This allows you to use the pick command to generate message numbers to use as input for other commands. For example, to scan all messages in the current folder that were sent after Tuesday, you would enter the following:
scan 'pick -after tuesday -list' 

If you do not specify a sequence, the -list flag is the default.

Messages Specifies the messages to search. You can specify several messages, a range of messages, or a single message. Use the following to specify messages:
Number
Number of the message.
Sequence
A group of messages specified by the user. Recognized values include:
all
All of the messages in the folder. This is the default.
cur or . (period)
Current message.
first
First message in a folder.
last
Last message in a folder.
new
New message that is created.
next
Message following the current message.
prev
Message preceding the current message.
-nolist Prevents the pick command from generating a list of the selected message numbers. If a sequence is specified, the -nolist flag is the default.
-nopublic Restricts a sequence to your usage. The -nopublic flag does not restrict the messages in a sequence, only the sequence itself. This option is the default if the folder is write-protected from other users.
-not Forms a logical NOT operation on a message-selecting flag; for example, pick -not -from george. This construction evaluates all messages not chosen by the message-selecting flag. The -not flag has precedence over the -and flag, and the -and flag has precedence over the -or flag. Use the -lbrace and -rbrace flags to override this precedence.
-nozero Appends the selected messages to the specified sequence.
-or Forms a logical OR operation on two message-selecting flags; for example, pick -from amy -or -from mark. The -not flag has precedence over the -and flag, and the -and flag has precedence over the -or flag. Use the -lbrace and -rbrace flags to override this precedence.
-public Allows other users access to a sequence. The -public flag does not make protected messages available, only the sequence itself. This option is the default if the folder is not write-protected from other users.
-rbrace Groups -and, -or, and -not operations. Operations between the -lbrace and -rbrace flags are evaluated as one operation. You can nest the -lbrace and -rbrace flags.
-search "Pattern" Selects messages that contain the character string specified by the "Pattern" variable anywhere in the message.
-sequence Name Stores the messages selected by the pick command in the sequence specified by the Name variable.
-to "Pattern" Selects messages that contain the character string specified by the "Pattern" variable in the To: field.
-zero Clears the specified sequence before placing the selected messages into the sequence. This flag is the default.
--Component "Pattern"
Selects messages that contain the character string specified by the "Pattern" variable in the heading field specified by the Component variable; for example, pick --reply-to amy.

Profile Entries

The following profile entries are part of the UserMHDirectory/.mh_profile file:

Current-Folder: Sets the default current folder.
Path: Specifies the user's MH directory.

Examples

  1. To get a list of message numbers in the current folder that are from user jones, enter:
    pick -from jones
    The system responds with a message similar to the following:
    12
    15
    19
  2. To see a list of message numbers in the schedule folder received within the last 30 days, enter:
    pick +schedule -after -30
    The system responds with a message similar to the following:
    5
    8
    21
    30

Files

$HOME/.mh_profile Contains the user's MH profile.
/usr/bin/pick Contains the pick command.

Related Information

The mark command.

The .mh_alias file format, .mh_profile file format.

Mail Overview in AIX Version 4.3 System User's Guide: Communications and Networks.

Peek, Jerry. MH and xmh: E-mail for Users and Programmers. Sebastopol, CA: O'Reilly & Associates, 1992.


[ Previous | Next | Contents | Glossary | Home | Search ]