Previous Topic: selang Commands ReferenceNext Topic: authorize Command—Set Access Authorities on a Resource


alias Command—Define selang Aliases

Valid on UNIX hosts

Use the alias command to list or define aliases for selang commands and properties. Any user can use the alias command.

Note: You can build a set of aliases to use in all selang sessions by defining those aliases in a startup file and using the selang r command.

This command has the following format:

alias [aliasName [aliasValue]]
aliasName

(Optional) Defines the name you want to use as alias.

If this option is not specified, the alias command lists all defined aliases.

aliasValue

(Optional) Defines the meaning that the selang command shell should associate with aliasName.

If this option is not specified, the alias command displays the value of the specified alias.

You can also include up to ten variables in aliasValue ($0 to $9). If aliasValue contains variables, you must replace each variable with the proper value in parentheses when invoking the alias.

Example: Use a Variable to Ease the Creation of New Administrators

To create an alias that makes adding new administrators to the database easier, enter the following command:

alias newadm newusr ($0) admin

To use this alias, simply add the names of the new administrators in brackets. For example:

newadm(Terri)

This adds a user called Terri to the database. Terri is given the ADMIN attribute which is required for administering the database. This is the same as entering the following command:

newusr Terri admin

Example: Simplify Property Names

To create an alias that replaces the property name access with the shortened alias acc, enter the following command:

alias acc access

You can now enter the following to use this alias:

authorize file x uid(y) acc(z)

Example: Use Aliases in Context

Aliases are not simply expanded variables; they are only interpreted in a context where a command name or a property name should be specified. For example, define the alias:

alias newterm newres terminal

Then issue the following command:

newterm newterm owner(nobody)

The first newterm string is replaced but not the second as the context requires the second instance of the string to be a terminal name. This is the same as entering the following command:

newres terminal newterm owner(nobody)

More information:

selang Utility—Run the CA ControlMinder Command Line

unalias Command—Remove selang Aliases