|DINO: Visualizing Structural Biology||
The DINO shell provides an interface between program and user, just as the UNIX shell provides an interface between operating system and user. The DINO shell offers a prompt in the terminal, where commands can be typed in. In essence, the input is parsed, some syntax rules are applied and the command line is broken down into words. The first word is checked against the internal shell commands, if no match is found the command line is passed to the database manager.
An expression enclosed in square brackets is considered a subprompt. It is evaluated first, and the result (return value) of the sub-expression is inserted at the position of the subprompt. Consider the following input:
A script is called with the @ sign, followed by the filename. Additional words are interpreted as parameters and are passed as variables to the script, accessible as $1 , $2 ... $n (n = number of arguments).
If the first word on the command line (or the first word in a subprompt!) matches ALIAS , it will be replaced by EXPRESSION (which can consist of multiple words). alias by itself will list all defined aliases.
To quit DINO use exit . To exit DINO use quit 1.
The commands push , pop , peek , opr , clear , dup and show manipulate the arithmetic RPN stack2. push moves all arguments onto the stack (from left to right). pop retrieves values from the stack, optionally into supplied variable names. peek returns the topmost value without removing it from the stack. opr takes a list of operator which are applied (left to right) to the stack. clear empties the stack. dup duplicates the top value. show displays the complete stack.
The availabe unary and binary operators are shown in Table 1 (P. 11).
polar2: ( (rname=SER & aname=OG) | (rname=THR & aname=OG1) | (rname=TYR & aname=OH) | (rname=HIS & aname=ND1,NE2) | (rname=CYS & aname=SG) | (rname=ASN & aname=OD1,ND1) | (rname=GLN & aname=OE1,NE1) | (rname=TRP & aname=NE1))
2. In a nutshell: In RPN (Reverse Polish Notation), a stack is filled with values, and an operator is called that uses the topmost value (unary op, e.g. sqrt) or the two topmost values (binary op, e.g. +), placing the value back on the stack. A simple arithmetic expression as 1+1 becomes 1 1 +, a more complex as (1+2)*(4/5+6) becomes 1 2 + 4 5 / 6 + *. People used to the HP calculators or programming PS will be familiar with this approach.