Formatting Strings

A formatting string is a string that contains field references; it is used to list the elements of a set.

A field reference consists of the name of a field, which can include an optional size specification (integer value).
  • The syntax for a field reference: @field@ or @field:size@.
  • The size can be used to format tables and reports.

Field Reference

@STATUS@ is a reference for the Status field. The name of the field in formatting strings is case insensitive and can contain underscores. The commands in the following example yield the same result:
% vovset show -O "@id@ @status@" System:jobs
% vovset show -O "@ID@ @STATUS@" System:jobs
% vovset show -O "@Id@ @S_t_A_t_U_s_@" System:jobs

Size Specification

The size specification consists of a colon and an integer and is used to format tables and reports.
  • If the field value is shorter than the specified size, the value is padded to the right with spaces in order to reach the desired size.
  • If the size is negative, the width of the formatted field is the absolute value of the size and the field is right-justified.
  • If the size is positive, the field is left-justified.
  • If the size is zero, the field is not truncated.
  • If the field value is shorter than the specified size, the value is padded to the right with spaces in order to reach the desired size.
  • If the size is negative, the width of the formatted field is the absolute value of the size and the field is right-justified.
  • If the size is positive, the field is left-justified.
  • If the size is zero, the field is not truncated.
  • If the absolute value of the size cannot exceed 1000.
  • If the absolute value of the size cannot exceed 1000.
  • Any character between the size specification and the second @ sign is silently dropped.

Each field reference is replaced by the corresponding value of the field for each node. If the field is incompatible for a node (for example, if a job node does not have a NAME field) the reference is replaced with the empty string.

For example:
% vovset show -O "id=@ID@ (@STATUS@)" System:jobs
id=001234567 (VALID)
% vovset show -O "id=@ID@ (@STATUS:12@)" System:jobs
id=001234567 (VALID       )
% vovset show -O "id=@ID@ (@STATUS:-12@)" System:jobs
id=001234567 (       VALID)
% vovset show -O "id=@ID@ (@STATUS:-12extra_chars_that_are_dropped@)" System:jobs
id=001234567 (       VALID)