ATTRLIST

attrlist - A dcecp object that manipulates attribute lists.

SYNOPSIS

attrlist add attrlist -member attrlist

attrlist getvalues attrlist -type typename

attrlist help [operation | -verbose]

attrlist list attrlist 

attrlist modify attrlist
[-add attribute_type attribute value...]
[-remove attribute_type attribute value...]
[-change attribute_type attribute value]

attrlist operations

attrlist remove attrlist -member attrlist

DESCRIPTION

The attrlist object represents an attribute list as returned or accepted by many dcecp commands. Use this object to check or manipulate attribute lists so that they can be used by other commands, most commonly in scripts.

ARGUMENTS

attrlist
A list of one or more dcecp elements. Usually a list consists of at least one attribute type and its value for example:
{CDS_Convergence medium}

operation
The name of one specific attrlist operation (subcommand) about which you want to see help information

ATTRIBUTES

The attrlist object has no attributes of its own.

OPERATIONS

attrlist add

Appends one attribute list to another.

attrlist add attrlist -member attrlist

The attrlist add command returns an attribute list with the attributes specified as the value of the required -member option appended.

Privilege Required

No special privileges are needed to use the attrlist add command.

Examples

dcecp> attrlist add {{a b} {c d}} -member {{e f} {g h}}
{a b} {c d} {e f} {g h}
dcecp>

attrlist getvalues

Returns specified attributes from an attribute list. The syntax is:

attrlist getvalues attrlist -type typename

The attrlist getvalues command returns the values of all attributes of a type specified by the value of the required -type option. The value may only be a single type, but the if the attribute appears more than once in the attribute list, the value of each instance is returned on a separate line.

Privilege Required

No special privileges are needed to use the attrlist getvalues command.

Examples

dcecp> attrlist getvalues {{a w x} {c y} {a z} -type a
{w x}
z
dcecp>

This command is likely to be used as commonly as grep to filter the output of `show' commands. For example:

dcecp> attrlist getvalues [dir show /.:/hosts] -type CDS_UTS
1994-07-01-10:29:59.265-05:00I0.000/00-00-c0-f7-de-56
dcecp>

With abbreviations this could be entered as:

dcecp> at g [dir show /.:/hosts] -t CDS_UTS
1994-07-01-10:29:59.265-05:00I0.000/00-00-c0-f7-de-56
dcecp>

attrlist help

Returns help information about the attrlist object and its operations. The syntax is:

attrlist help [operation | -verbose]

Option

-verbose
Used with the help operation, displays information about the attrlist object.

Used without an argument or option, the attrlist help command returns brief information about each attrlist operation. The optional operation argument is the attrlist of an operation (add, getvalues, help, list, modify, operations, and remove) about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the attrlist object itself.

Privilege Required

No special privileges are needed to use the attrlist help command.

Examples

dcecp> attrlist help
add             Add attributes to a list
getvalues       Return the values of specified attributes
list            Return the attribute types present in a list
modify          Modify an attribute list
remove          Remove attributes from a list
help            Print summary of command-line options and abort
operations      Return valid operations for command.
dcecp>

attrlist list

Returns a list of attribute type names from an attribute list. The syntax is:

attrlist list attrlist

The attrlist list command returns a list of all the attribute type names in the attribute list in the order that they appear in the list.

Privilege Required

No special privileges are needed to use the attrlist list command.

Examples

dcecp> attrlist list {{a b} {c d}}
a c
dcecp>

attrlist modify

Removes and changes attributes and their values in an attribute list. The syntax is:

attrlist modify attrlist
[-add attribute_type attribute value...]
[-remove attribute_type attribute value...]
[-change attribute_type attribute value]

The attrlist modify command returns an attribute list with attributes modified as specified by the -add, -remove and -change options. New attributes can be added, or new values added to existing attributes with -add. Entire attributes or attribute values can be removed with -remove. The -change option will remove all values from an existing attribute and replace them with new values specified.

Privilege Required

No special privileges are needed to use the attrlist modify command.

Examples

dcecp> attrlist modify{{a b} {c d}} -add {{c e}}
{a b} {c d e}
dcecp>
dcecp> attrlist modify {{a b} {c d e}} -remove {{c e}} 
{a b} {c d}
dcecp>
dcecp> attrlist modify {{a b} {c d e}} -change {{c f}}
{a b} {c f}
dcecp>

attrlist operations

Returns a list of the operations supported by the attrlist object. The syntax is:

attrlist operations

The operations operation takes no arguments, and returns a list of the available operations for the attrlist object. The order of the elements is alphabetical with the exception that help and operations are listed last.

Privilege Required

No special privileges are needed to use the attrlist operations command.

Examples

dcecp> attrlist operations
add getvalues list modify remove help operations
dcecp>

attrlist remove

Removes attributes and their values from an attribute list. The syntax is:

attrlist remove attrlist -member attrlist

The attrlist remove command returns an attribute list after removing attribute types (and their values) specified as an argument to the required -member option.

This command removes only entire attributes; to remove specific values, use the attrlist modify command.

Privilege Required

No special privileges are needed to use the attrlist remove command.

Examples

dcecp> attrlist remove {{a b} {c d} {e f} {g h}} -member {e g}
{a b} {c d}
dcecp>

RELATED INFORMATION

Commands: dcecp(8dce) uuid(8dce) utc(8dce)


© 1990-1996, Transarc Corporation