List Functions
listAppend
Add an item to a character-delimited list.
Usage
listAppend listValue separator [ --first ] [ --last ] [ item ] [ --help ]
Add an item to a list IFF it does not exist in the list already Add an item to the beginning or end of a text-delimited list
Arguments
listValue- Required. List value to modify.separator- Required. Separator string for item values (typically:)--first- Flag. Optional. Place any items after this flag first in the list--last- Flag. Optional. Place any items after this flag last in the list. Default.item- the value to be added to thelistValue--help- Flag. Optional. Display this help.
Return codes
0- Success1- Environment error2- Argument error
listContains
Does a character-delimited list contain item(s)?
Usage
listContains listValue separator [ item ... ] [ --help ]
Return code 0 IFF all items are found in the list. If any item is not found, returns code 1. If no items are passed in the return value is 0 (true). Add an item to the beginning or end of a text-delimited list
Arguments
listValue- Required. List value to search.separator- Required. Separator string for item values (typically:)item ...- Optional. the item to be searched for in thelistValue--help- Flag. Optional. Display this help.
Return codes
0- All items are found in thelistValue1- One or more items were NOT found in thelistValue
listRemove
Remove one or more items from a text-delimited list
Usage
listRemove listValue separator [ item ] [ --help ]
Remove one or more items from a text-delimited list
Arguments
listValue- Required. List value to modify.separator- Required. Separator string for item values (typically:)item- the item to be removed from thelistValue--help- Flag. Optional. Display this help.
Return codes
0- Success1- Environment error2- Argument error
listJoin
Output a list of items joined by a character
Usage
listJoin separator [ text0 ... ] [ --help ]
Output a list of items joined by a character
Arguments
separator- EmptyString. Required. Single character to join elements. If a multi-character string is used only the first character is used as the delimiter.text0 ...- String. Optional. One or more strings to join--help- Flag. Optional. Display this help.
Sample Output
text
Return codes
0- Success1- Environment error2- Argument error
listCleanDuplicates
Removes duplicates from a list and maintains ordering.
Usage
listCleanDuplicates separator listText [ --removed ] [ --test testFunction ] [ --help ]
Removes duplicates from a list and maintains ordering.
Arguments
separator- String. Required. List separator character.listText- String. Required. List to clean duplicates.--removed- Flag. Optional. Show removed items instead of the new list.--test testFunction- Function. Optional. Run this function on each item in the list and if the return code is non-zero, then remove it from the list.--help- Flag. Optional. Display this help.
Return codes
0- Success1- Environment error2- Argument error