ASSIGN(1) COMMAND REFERENCE ASSIGN(1) NAME assign, deassign - assign or deassign devices in a class SYNOPSIS assign [ -f ] [ -r ] class ... deassign class ... DESCRIPTION The assign and deassign commands use the file /etc/assign.classes to determine what devices are assignable and what class(es) they belong to. Assignable devices are divided into classes (e.g. mag tape drive 0) so that all versions of a device can be assigned together (raw and cooked versions for example). These classes, in turn, may be grouped into generic classes (e.g. any mag tape drive). These groupings are set up by the system administrator, and thus are installation dependent. Assign changes the owner of the device(s) in the requested class to the current UID. If the requested class is a generic one, the first specific class found that is available is used. The device(s) assume protection mode of read and write by owner only. If more than one class is listed, the first one that contains an assignable device is used and the remainder are ignored. This allows the user to specify the order that classes will be checked. The name of the specific class that was assigned is typed on standard output. If no devices are available in the class(es) desired, an error message is typed on standard error, and the program exits with return code 1, unless the -r option is used. Deassign undoes the work of assign by releasing the device to the assignable pool. The special form deassign all will deassign all devices you have. All devices are considered available to the superuser. If the log file does not exist, logging is ignored. The owner of devices that are free for assignment is the owner of the file /etc/assign.classes. OPTIONS -f Does not prompt whether to deassign when used in conjunction with the -r flag. This allows assign -r to be used in a shell script. -r Reassigns the devices of a requested class after determining that no requested class is available without overriding an assignment. Mail is sent to the user with the previous assignment. Unless used with the -f flag, a prompt is issued to determine whether to override the Printed 4/6/89 1
ASSIGN(1) COMMAND REFERENCE ASSIGN(1) previous assignment of the device(s). EXAMPLES assign mt1 mt0 would try to assign class mt1, and would try for mt0 only if mt1 is unavailable. Typical usage might be (using the Bourne shell): mt=`assign mt` while test ! "${mt}" do sleep 120; mt=`assign mt`; done Do whatever needs doing on the mag tape using device names: /dev/${mt}0 for 800 BPI cooked /dev/${mt}1 for 1600 BPI cooked /dev/r${mt}0 for 800 BPI raw /dev/r${mt}1 for 1600 BPI raw /dev/n${mt}0 for 800 BPI cooked, no rewind on close /dev/n${mt}1 for 1600 BPI cooked, no rewind on close /dev/nr${mt}0 for 800 BPI raw, no rewind on close /dev/nr${mt}1 for 1600 BPI raw, no rewind on close This assumes that the system administrator has set up a generic class name in /etc/assign.classes of mt and a specific class names of form mt0, mt1, mt2 ... and that the tape versions of the tape drives are named /dev/mt00, /dev/mt01, /dev/rmt00 ... The shell variable mt will have the name of the assigned tape drive (e.g. mt0, mt1, mt2 ...) FILES /etc/assign.classes System file containing class specifications /usr/adm/devicelog Log file for device usage RETURN VALUE [NO_ERRS] Command completed without error. [1] No available class was found. [USAGE] Incorrect command line syntax. Execution terminated. [NP_WARN] An error warranting a warning message occurred. Execution continues. [NP_ERR] An error occurred that was not a system Printed 4/6/89 2
ASSIGN(1) COMMAND REFERENCE ASSIGN(1) error. Execution terminated. [P_WARN] A system error occurred. Execution continues. See intro(2) for more information on system errors. [P_ERR] A system error occurred. Execution terminated. See intro(2) for more information on system errors. SEE ALSO assign.classes(5). Printed 4/6/89 3
%%index%% na:288,108; sy:396,330; de:726,2362; op:3088,662;4110,47; ex:4157,1314; fi:5471,275; rv:5746,492;6598,395; se:6993,171; %%index%%000000000153