Scripting Commands
You can use advanced scripting constructs to combine multiple commands and write complex scripts.
The Shell commands supports the following advanced constructs for scripting:
Arrays
Arrays can be passed as arguments to some commands. For example, the
echo command takes an array of arguments passed to it and displays them at the command prompt.
echo [ 'a' 'b' 'c'] [a,b,c]
Running Multiple Commands at Once
Multiple commands can be run by separating them with a
';' (semicolon).
admin@localhost:/> cd /TEA;ls Machines Solutions Groups Users Roles Realms Permissions OperatorViewManager SearchViewManager Agents
Pipes
Output of one command can be piped to the input of another command using a '|'.admin@localhost:> ls /TEA/Roles | grep a Tomcat Admin Tomcat User
Closures
Closures are functions which can be invoked with arguments. You can define and invoke the functions at runtime. Curly braces, '{ ' and '} ' are used to enclose a closure definition.admin@sgaurav-t420:/TEA> each { ls } {show info $it}
Name:Machines
Type:tea:1.1.0:teaMachines
Name:Solutions
Type:tea:1.1.0:solutions
Name:Groups
Type:tea:1.1.0:groups
Name:Users
Type:tea:1.1.0:users
Name:Roles
Type:tea:1.1.0:roles
Name:Realms
Type:tea:1.1.0:realms
Name:Permissions
Type:tea:1.1.0:permissions
Name:OperatorViewManager
Type:tea:1.1.0:operatorViewManager
Name:SearchViewManager
Type:tea:1.1.0:searchViewManager
Name:Agents
Type:tea:1.1.0:agents
admin@localhost:>
Copyright © Cloud Software Group, Inc. All Rights Reserved.