Customizing the user environment

Identifier variables

With many login script commands, you can take advantage of identifier variables to make your login script more efficient and flexible.

Identifier variables allow you to enter a variable (such as LAST_NAME), rather than a specific name (such as Smith) in a login script command. When the login script executes, it substitutes real values for the identifier variables.

By using the variable, you can make the login script command applicable to many users instead of limiting it to one user.

For example, the command

   WRITE "Hello, "%LAST_NAME
displays the following message on Bob's Smith's workstation screen when he logs in:
   Hello, SMITH
Similarly, when Mary Jones logs in, the message she sees is
   Hello, JONES
In the previous example, when the user logged in, the user's actual last name was substituted for the LAST_NAME variable in the command.

The following table lists all the available identifier variables:

Login script identifier variables

Category Identifier Variable Function
Date DAY Day number (01 through 31)
DAY_OF_WEEK Day of week (Monday, Tuesday, and so on.)
MONTH Month number (01 through 12)
MONTH_NAME Month name (January, February, and so on.)
NDAY_OF_WEEK Weekday number (1 through 7; 1=Sunday)
SHORT_YEAR Last two digits of year (94, 95, 96, and so on.)
YEAR All four digits of year (1994, 1995, 1996, and so on.)
Time AM_PM Day or night (am or pm)
GREETING_TIME Time of day (morning, afternoon, or evening)
HOUR Hour (12-hour scale; 1 through 12)
HOUR24 Hour (24-hour scale; 00 through 23; 00=midnight)
MINUTE Minute (00 through 59)
SECOND Second (00 through 59)
User %CN User's full login name as it exists in NDS
ALIAS_CONTEXT "Y" IF REQUESTER_CONTEXT is an alias
FULL_NAME User's unique username. It is the value of the FULL_NAME property for both NDS and bindery-based NetWare. Spaces are replaced with underscores.
LAST_NAME User's last name (surname) in NDS or full login name in bindery-based NetWare.
LOGIN_CONTEXT Context where user exists.
LOGIN_NAME User's unique login name (long names are truncated to eight characters).
MEMBER OF "group" Group object to which the user is assigned.
NOT MEMBER OF "group" Group object to which the user is not assigned.
PASSWORD_EXPIRES Number of days before password expires.
REQUESTER_CONTEXT Context when login started.
USER_ID Number assigned to each user.
Network FILE_SERVER NetWare server name.
NETWORK_ADDRESS IPX external network number of the cabling system (8-digit hexadecimal number).
Workstation MACHINE Type of computer (IBM_PC, and so on).
NETWARE_REQUESTER Version of the NetWare Requester for OS/2 or VLM users.
OS Type of DOS on the workstation (MSDOS, OS/2, and so on).
OS_VERSION Operating-system version on the workstation (3.30, and so on.).
P_STATION Workstation's node address (12-digit hexadecimal).
SHELL_TYPE Version of the workstation's DOS shell (1.02, and so on.); supports NetWare 2 and 3 shells and NetWare 4 Requester for DOS.
SMACHINE Short machine name (IBM, and so on).
STATION Workstation's connection number.
DOS environment <variable> Any DOS environment variable can be used in angle brackets (<path>, and so on). To use a DOS environment variable in MAP, COMSPEC, and FIRE PHASERS commands, add a percent sign (%) in front of the variable. For example, MAP S16:=%<path>
Miscellaneous ACCESS_SERVER Shows whether the access server is functional (TRUE=functional, FALSE=not functional).
ERROR_LEVEL An error number (0=no errors).
%n Replaced by parameters the user enters at the command line with the LOGIN utility. For more information, see ``Using LOGIN parameters with %n variables''.
Object properties property name You can use property values of NDS objects as variables. Use the property values just as you do any other identifier variable. If the property value includes a space, enclose the name in quotation marks
To use a property name with a space within a WRITE statement, you must place it at the end of the quoted string:
WRITE "Given name=%GIVEN_NAME"
IF "%MESSAGE SERVER"="MS1" THEN
MAP INS S16:=MS1\SYS:EMAIL
To see a list of object properties, see the nlist(1nuc) manual page. Not all properties are supported.

 Category            Identifier Variable   Function
 Date                DAY                   Day number (01
                                           through 31)
                     DAY_OF_WEEK           Day of week
                                           (Monday, Tuesday,
                                           and so on.)
                     MONTH                 Month number (01
                                           through 12)
                     MONTH_NAME            Month name
                                           (January, February,
                                           and so on.)
                     NDAY_OF_WEEK          Weekday number (1
                                           through 7;
                                           1=Sunday)
                     SHORT_YEAR            Last two digits of
                                           year (94, 95, 96,
                                           and so on.)
                     YEAR                  All four digits of
                                           year (1994, 1995,
                                           1996, and so on.)
 Time                AM_PM                 Day or night (am or
                                           pm)
                     GREETING_TIME         Time of day
                                           (morning,
                                           afternoon, or
                                           evening)
                     HOUR                  Hour (12-hour
                                           scale; 1 through
                                           12)
                     HOUR24                Hour (24-hour
                                           scale; 00 through
                                           23; 00=midnight)
                     MINUTE                Minute (00 through
                                           59)
                     SECOND                Second (00 through
                                           59)
 User                %CN                   User's full login
                                           name as it exists
                                           in NDS
                     ALIAS_CONTEXT         "Y" IF
                                           REQUESTER_CONTEXT
                                           is an alias
                     FULL_NAME             User's unique
                                           username. It is the
                                           value of the
                                           FULL_NAME property
                                           for both NDS and
                                           bindery-based
                                           NetWare. Spaces are
                                           replaced with
                                           underscores.
                     LAST_NAME             User's last name
                                           (surname) in NDS or
                                           full login name in
                                           bindery-based
                                           NetWare.
                     LOGIN_CONTEXT         Context where user
                                           exists.
                     LOGIN_NAME            User's unique login
                                           name (long names
                                           are truncated to
                                           eight characters).
                     MEMBER OF "group"     Group object to
                                           which the user is
                                           assigned.
                     NOT MEMBER OF         Group object to
                     "group"               which the user is
                                           not assigned.
                     PASSWORD_EXPIRES      Number of days
                                           before password
                                           expires.
                     REQUESTER_CONTEXT     Context when login
                                           started.
                     USER_ID               Number assigned to
                                           each user.
 Network             FILE_SERVER           NetWare server
                                           name.
                     NETWORK_ADDRESS       IPX external
                                           network number of
                                           the cabling system
                                           (8-digit
                                           hexadecimal
                                           number).
 Workstation         MACHINE               Type of computer
                                           (IBM_PC, and so
                                           on).
                     NETWARE_REQUESTER     Version of the
                                           NetWare Requester
                                           for OS/2 or VLM
                                           users.
                     OS                    Type of DOS on the
                                           workstation (MSDOS,
                                           OS/2, and so on).
                     OS_VERSION            Operating-system
                                           version on the
                                           workstation (3.30,
                                           and so on.).
                     P_STATION             Workstation's node
                                           address (12-digit
                                           hexadecimal).
                     SHELL_TYPE            Version of the
                                           workstation's DOS
                                           shell (1.02, and so
                                           on.); supports
                                           NetWare 2 and 3
                                           shells and NetWare
                                           4 Requester for
                                           DOS.
                     SMACHINE              Short machine name
                                           (IBM, and so on).
                     STATION               Workstation's
                                           connection number.
 DOS environment     <variable>            Any DOS environment
                                           variable can be
                                           used in angle
                                           brackets (<path>,
                                           and so on). To use
                                           a DOS environment
                                           variable in MAP,
                                           COMSPEC, and FIRE
                                           PHASERS commands,
                                           add a percent sign
                                           (%) in front of the
                                           variable. For
                                           example, MAP
                                           S16:=%<path>
 Miscellaneous       ACCESS_SERVER         Shows whether the
                                           access server is
                                           functional
                                           (TRUE=functional,
                                           FALSE=not
                                           functional).
                     ERROR_LEVEL           An error number
                                           (0=no errors).
                     %n                    Replaced by
                                           parameters the user
                                           enters at the
                                           command line with
                                           the LOGIN utility.
                                           For more
                                           information, see
                                           ``Using LOGIN
                                           parameters with %n
                                           variables''
 Object properties   property name         You can use
                                           property values of
                                           NDS objects as
                                           variables. Use the
                                           property values
                                           just as you do any
                                           other identifier
                                           variable. If the
                                           property value
                                           includes a space,
                                           enclose the name in
                                           quotation marks
                                           To use a property
                                           name with a space
                                           within a WRITE
                                           statement, you must
                                           place it at the end
                                           of the quoted
                                           string:
                                           WRITE "Given name=%GIVEN_NAME"
                                           IF "%MESSAGE SERVER"="MS1" THEN
                                           MAP INS S16:=MS1\SYS:EMAIL
                                           To see a list of
                                           object properties,
                                           see the nlist(1nuc)
                                           manual page. Not
                                           all properties are
                                           supported.

© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999