Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chkyn(1) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

chkyn(1)  —  USER COMMANDS

NAME

chkyn − get yes/no response from user or check answer to question

SYNOPSIS

chkyn [−ynfeid!] [−D defaultvalue] [−k pid]
          [−q inputvalue] [−Q aliasname]
[−h helpstring] [−H helpmessage] [−m number] Prompt String

chkyn [−c] Prompt String answer . . .

chkyn [−r] Prompt String answer message . . .

chkyn [−R] Prompt String answer message . . .

DESCRIPTION

chkyn is primarily used by the sysadm (system administration) package.  This utility is useful in a variety of shell script applications. 

chkyn prints out the Prompt String, followed by the possible answers, and asks the user for input.  The handling of user input is controlled by the command line options. 

chkyn exits with an exit value of 0 for yes or 1 for no. 

The following command line options are supported by chkyn:

−y Default answer to prompt is yes. 

−n Default answer to prompt is no. 

−f Force an answer.  If the answer supplied by the user is not valid, ask the question again, and continue asking until a valid answer is obtained. 

−e Echo the answer.  This allows a shell script to capture the response which the user typed in. 

−c Prompt String answer . . .
Check a list. This is often used in conjunction with the −f option, which forces an answer.  chkyn prompts the user with the prompt string (which does not automatically include a question mark), then expects a reply that matches one of the answer fields.  The exit code of chkyn indicates which item from the list of answers was chosen; an exit code higher than the number of items in the list indicates the user’s entry did not match any of the list items. 

−r Prompt answer message . . .
Accept matching regular expressions. This is most useful with the −f option, which forces an answer.  The user supplies a regular expression in answer; chkyn prints message if a nonmatching answer is given. 

−R Reject matching regular expressions.  This works the same as −r, except that if an answer from the list is matched, chkyn prints the corresponding message and considers this an invalid answer. 

−i Match an integer expression.  This requires the bs utility, which is not supported on SYSTEM V/88. 

−d Match a decimal expression.  This requires the bs utility, which is not supported on SYSTEM V/88. 

−D value
The default value for an empty input. Must be accompanied by a −c, −r, −i or −d option. 

−k pid Quit sends SIGTERM to this process id.  Used with the −q or −Q options, which define quit. 

−q input
Input that causes quit.

−Q alias
Alias name for quit.

−h helpstring
String to request help. −h and −H must both be specified. 

−H helpmessage
Help message to display. −h and −H must both be specified. 

−m number
Maximum number of times to ask a question.

−! Permit shell escapes from prompt. 

DIAGNOSTICS

Exit value from chkyn is basically 0 for true or 1 for false.  When a list of acceptable answers is provided (as with the −c option), the exit code points to the matched item in the list.  A higher exit code indicates no item was matched. 

NOTES

Since chkyn is part of the sysadm package, the options and command syntax may change in future releases to support the requirements of sysadm.  User scripts that depend on certain functions of chkyn would need to be rewritten at that time. 

The meaning of multiple answer/message pairs with the −r option is not clear. 

  —  Essential Utilities

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026