Revision 10 as of 2006-08-29 17:59:47

Clear message

Ponder2 Shell

Ponder2 has a built-in shell to allow a user to interact with the SMC using simple commands.

The shell acts in some way similarly to the Unix Bourn Shell, you can move around the domain hierarchy using the change domain (cd) command, you can list things with the ls command etc. etc.

The syntax for shell commands is:

<shellcommand> [<arg>]+  where <command> is an internal or managed object command or XML

Internal Commands

Internal commands are built into the shell and can be used to manipulate the domain structure and to look at managed objects within the system.






cd [pathname]

change domain

sets the current domain to the pathname. If no argument then goes to the root domain


ls [-l] [-p] [pathname]*


lists contents of domains or objects. -l give more detail, -p lists policies applying to a managed object

||<style="vertical-align: top;">mkdom, mkdir, md ||<style="vertical-align: top;">mkdom pathname ||<style="vertical-align: top;">make domain ||<style="vertical-align: top;">creates and adds a new domain to the domain hierarchy ||


event name [arg]*

create event

instantiates an event type and sends it into the system. The name is interpreted as an Event Type relative to the current domain or within the '/event' domain


lp [policy]+

list policy

lists the contents of a policy in XML


ln fromname toname


includes the fromname managed object in the toname domain

Managed Object Commands

If the command is not recognised by the shell to be an internal command, the shell looks within the system and tries to find a managed object of the same name. It will match either an object in the current domain or maybe one from the root domain is the name starts with a '/'. If such a manged object is located, the command line is turned into an XML structure and sent to that managed object as a command. See the [:Ponder2Example#shell:worked example] for an example use of this type of command.

Managed Object Commands are turned into XML structures in the following manner:

<!ManagedObjectName> [useattribute=value]* [MOcommand1 [cmnd1att=value2]*]*
Where [...]* means optional argument which may be repeated

Example Managed Object Shell Commands



alarmclock show=true

<use name='/alarmclock' show='true'/>

alarmclock show

<use name!='/alarmclock><show/></use>

alarmclock show=true ring duration=5 hide

<use name='/alarmclock' show='true'><ring duration='5'/><hide/></use>



The Managed Object Commands described above are only capable of creating simple commands for managed objects. If more complex commands are required then full XML has to be written. [:Ponder2XML:Ponder2 XML] can be given to the shell using the special <xml> command. XML is terminated by a '.' on a line by itself after the final </xml> e.g. Note: depending how you cut and paste your XML you may get one or more [XML or . to terminate] lines.

$ <xml>
   <use name='/alarmclock'>
     <alarm state='on'>
         This is an alarm
[XML or . to terminate]$    </use>
[XML or . to terminate]$ </xml>
[XML or . to terminate]$ .
Parsed XML input