Changeset 4734
- Timestamp:
- Aug 9, 2005, 2:14:16 PM (21 years ago)
- Location:
- trunk/Ohana/doc/www/html
- Files:
-
- 2 edited
-
IPP-subsystems/pclient/index.htm (modified) (2 diffs)
-
Opihi-Programs/index.htm (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/doc/www/html/IPP-subsystems/pclient/index.htm
r4732 r4734 3 3 <meta name=page content=pclient summary> 4 4 5 #pclient/#is the remote process monitor for pcontrol, the parallel5 <tt>pclient</tt> is the remote process monitor for pcontrol, the parallel 6 6 process controller. 7 7 … … 9 9 10 10 <p> 11 The program #pclient/#is used to support the remote jobs which are12 run on the remote hosts by #pcontrol/#. The concept of pclient is to11 The program <tt>pclient</tt> is used to support the remote jobs which are 12 run on the remote hosts by <tt>pcontrol</tt>. The concept of pclient is to 13 13 act as a buffer between the job running on the remote host and 14 14 pcontrol. The pcontrol design uses (by default) ssh connections -
trunk/Ohana/doc/www/html/Opihi-Programs/index.htm
r4733 r4734 13 13 arithmetic on variables, input from source files, and a variety of 14 14 other useful tools. Opihi has a simple command-line interaction that 15 resembles the UNIX tcsh, but with many additional useful features. It 16 can also be used as a scripting language much like #sh/# or perl. 15 resembles the UNIX <tt>tcsh</tt>, but with many additional useful 16 features. It can also be used as a scripting language much like 17 <tt>sh</tt> or perl. 17 18 18 19 <p> 19 20 Opihi includes tools to manipulate and display 1-D (vector) and 2-D 20 (matrix) data. Two external programs are used to graphical display. 21 These are the image display tool (Kii), the graphing tool (Kapa), and 22 the vector and matrix manipulation commands. Various functions are 23 available to perform math, statistical, and other operations on 24 vectors and images. 21 (image) data. Two external programs are used for graphical display: 22 the image display tool (Kii) and the graphing tool (Kapa). Various 23 functions are available to perform math, statistical, and other 24 operations on vectors and images. 25 25 26 26 <h3> User Interface </h3> … … 28 28 <p> 29 29 The command-line interaction is based on the readline libraries and 30 behaves like tcsh. Arrows can be used for editing. There is both 31 command and file completion with the TAB key. Multiple commands can 32 generally be placed on one line with semi-colons as separators. 33 34 The interface has an interaction similar to <tt>tcsh</tt>. The arrows 35 allow editing of previous commands. You can also use emacs-like 36 commands such as cntl-a to reach the beginning of the line and cntl-e 37 to reach the end. There is command and file completion: if you type 38 part of a command (as the first thing on a line) and then type tab, it 39 will fill in as much as possible, until the word is not unique. 40 Typing tab twice at that point will list the possible endings. For 41 any but the first word on a line, the same thing will happen for the 42 files in the current directory. It is also possible to type just a 30 behaves like #tcsh/#. Arrows can be used for editing. There is both 31 command and file completion with the TAB key. You can also use 32 emacs-like commands such as ctrl-a to reach the beginning of the line 33 and ctrl-e to reach the end. It is also possible to type just a 43 34 fraction of a command, as long as it is unique. An ambiguous command 44 35 will list the possible alternatives. For example: 45 36 46 37 <pre> 47 dvo: c38 opihi: c 48 39 ambiguous command: c ( catalog cgrid clear create cursor ) 49 40 </pre> 50 41 51 The shell is an interpretive programming language. 42 Multiple commands can generally be placed on one line with semi-colons 43 as separators. 52 44 53 45 <h3> Data Representations</h3> … … 56 48 57 49 <p> 58 Scalar variables in Opihi are pr oceeded with a dollar sign ($). A50 Scalar variables in Opihi are prepended with a dollar sign ($). A 59 51 variable may be created and the value assigned by a line which looks 60 like: 52 like: 61 53 62 54 <p class=eq> … … 67 59 consist of the standard math operators (+,-,*,/) as well as any 68 60 already-defined variables and the functions log(), ln(), sqrt(), 69 exp(), ten() ($10^x$), sin(), cos(), etc. Variables can be numeric or character strings. If 70 the shell does not understand the syntax of the line as a math 71 expression, it is assumed to be a string. 61 exp(), ten() ($10^x$), sin(), cos(), etc. Other special operators are 62 the carret (^) for exponetiation (eg, 2^3 is 8) and the @ symbol as a 63 binary arc-tangent (eg, 1@3 is 18.43 degrees). In addition, the 64 operator #<</# returns the minimum of the two surrounding values, and 65 #>>/# returns the maximum. Variables can be numeric or character 66 strings. If the shell does not understand the syntax of the line as a 67 math expression, it is assumed to be a string. 68 69 <em>local variables</em> 72 70 73 71 <p> 74 72 If there is a pair of curly brackets {} anywhere on a command line, 75 whatever is inside is assumed to be a math expression and evaluated as 76 well. This later feature allows functions of variables to be passed 77 as arguments to Opihi functions. (see also the discussion below about 78 temporary vectors and images). 79 80 Any expression within curly brackets {} is assumed 81 to be an arithmetical expression and is evaluated before the line is 82 executed. For example: 73 whatever is inside is assumed to be a math expression and evaluated 74 before the line is executed. This later feature allows functions of 75 variables to be passed as arguments to Opihi functions. (see also the 76 discussion below about temporary vectors and images). 77 For example: 83 78 84 79 <pre> … … 86 81 </pre> 87 82 88 would give the response 7.07107 . There are math functions cos, sin,89 a nd tan, which operate on radian expressions, and also dcos, dsin,90 dtan, which operate on degree expressions. There are also the 91 equivalent inverse functions: eg., asin and dasin return radians and 92 degrees, respectively. The help section on Math defines all of the 93 available math functions. 83 would give the response 7.07107 if $fred had the value of 10.0. There 84 are math functions #cos/#, #sin/#, and #tan/#, which operate on radian 85 expressions, and also #dcos/#, #dsin/#, #dtan/#, which operate on 86 degree expressions. There are also the equivalent inverse functions: 87 eg., #asin/# and #dasin/# return radians and degrees, respectively. 88 The help section on Math defines all of the available math functions. 94 89 95 90 <h4> Lists </h4> … … 97 92 Opihi lists are grouped sets of scalar variables (which may be 98 93 strings). A list consists of N variables with names of the form 99 <tt>name:i /#, where the value of i ranges from 0 to N-1. In addition,100 the list length is defined as the value #name:n/#. Since these are94 <tt>name:i</tt>, where the value of i ranges from 0 to N-1. In addition, 95 the list length is defined as the value <tt>name:n</tt>. Since these are 101 96 just informally grouped, a list may be defined by hand (ie, by 102 97 defining each element and the length). There is also the command 103 #list/#which builds a list from the following lines until reaching104 a line consisting of the single word #end/#:98 <tt>list</tt> which builds a list from the following lines until reaching 99 a line consisting of the single word <tt>end</tt>: 105 100 106 101 <pre> … … 112 107 </pre> 113 108 114 will define the variables #$sample:0 - $sample:2/#, and #$sample:n/#,109 will define the variables <tt>$sample:0 - $sample:2</tt>, and <tt>$sample:n</tt>, 115 110 with value of 3. 116 111 … … 138 133 A queue is a data construct consisting of a sequence of lines from 139 134 which simple selections can be made. Data items are added and removed 140 from the queue with #queuepush/# and #queuepop/#commands which push135 from the queue with <tt>queuepush</tt> and <tt>queuepop</tt> commands which push 141 136 entries on the end of the queue and pop them off the beginning. The 142 available queues may be obtained with the command #queuelist/#, and143 the length of a specific queue may be determined with the #queuesize/#144 command. The contents of a queue may be printed with #queueprint/#.137 available queues may be obtained with the command <tt>queuelist</tt>, and 138 the length of a specific queue may be determined with the <tt>queuesize</tt> 139 command. The contents of a queue may be printed with <tt>queueprint</tt>. 145 140 Pushing data onto a non-existent queue will create the queue. An 146 empty queue may be created with the command #queueinit/#and a queue147 may be deleted with #queuedelete/#.148 149 <p> 150 The #queuepush/#commands allows for additional options which modify151 how the data is pushed on the queue. The #-uniq/#flag specifies that141 empty queue may be created with the command <tt>queueinit</tt> and a queue 142 may be deleted with <tt>queuedelete</tt>. 143 144 <p> 145 The <tt>queuepush</tt> commands allows for additional options which modify 146 how the data is pushed on the queue. The <tt>-uniq</tt> flag specifies that 152 147 the queue should be search for an existing match and not add the new 153 data item if a matching item already exists. The #-replace/#flag is154 similar to the #-uniq/#flag, but instead the new item will replace148 data item if a matching item already exists. The <tt>-replace</tt> flag is 149 similar to the <tt>-uniq</tt> flag, but instead the new item will replace 155 150 the existing match, if a match is found. These two options have 156 151 identical results if the match is made based on the entire line. 157 152 However, they may be more usefully distinguished by specifying a 158 restriction on the match with the #-key/#flag. This flag specified153 restriction on the match with the <tt>-key</tt> flag. This flag specified 159 154 which whitespace-separated element of the line to use for the match, 160 155 with the first element being element 0. … … 164 159 document. 165 160 166 <h3> Flow-control block </h3> 167 <h3> Shell Programing </h3> 168 169 <pre> 170 break -- escape from function 171 for -- loops 172 if -- logical cases 161 <h3> Opihi Shell Programing and Flow-control</h3> 162 163 <pre> 173 164 input -- read command lines from a file 174 165 macro -- deal with the macros 175 </pre> 176 177 <p> 178 There are several options for programming in <tt>status</tt>. First, 166 for -- for loop 167 if -- logical cases 168 while -- while loop 169 break -- escape from function 170 continue -- next loop iteration 171 </pre> 172 173 <p> 174 There are several options for programming in the opihi shell. First, 179 175 a file which contains a series of commands can be executed with 180 <tt>input (filename)</tt>. It is also possible to define macros which 181 will behave much like regular commands. A macro is defined by typing 182 <tt>macro name</tt> or <tt>macro create name</tt> followed by the 183 commands. Arguments to the macro are assigned to the variables $1 184 .. $N and the number of arguments is given by $0. Macros may be 185 defined in <tt>input</tt> files, and in fact when <tt>status</tt> is 186 started, it loads the file <tt>~/.statusrc</tt> which may contain 187 default macros. Simple loops and if statements can be performed, and 188 are quite useful for complex macros. 189 190 <p> 191 'If' statements are similar in syntax to C if statements. Math 192 expresions in the if statement must be contained in curly braces, as 193 elsewhere. Variables with string values may use the logical == 194 operator to test if two strings are the same. 'For' loops are quite 195 simplistic. The form is: 196 197 <pre> 198 for var first last delta 199 (commands) 200 end 201 </pre> 202 203 <p> 204 The value of <tt>$var</tt> will start at the value <tt>first</tt> and increment by 205 <tt>delta</tt> after each loop. The loop will stop after <tt>$var</tt> is greater 206 than <tt>stop</tt>. The value <tt>delta</tt> is optional, with 1 assumed. 207 The value of <tt>$var</tt> may be changed during the loop, and if set 208 beyong the value of <tt>last</tt> will end the loop early. 209 210 211 <p> 212 Opihi has several types of flow-control features. These include 213 for-loops, while-loops, if-else blocks. These blocks are defined by 214 the corresponding command (#for/#, #while/#, #if/#) and are terminated 215 with by a line with the single word #end/#. 216 217 <p> 218 The for loop syntax is simplistic. The #for/# command specifies the 219 loop variable, the starting value, the ending value, and optionally 220 the delta for each loop. The implicit loop test is always to check if 221 the loop variable is still less than the end value (or greater than if 222 the delta value is negative). The definitions of this loop syntax and 223 the value of the list length (#$list:n/#) and the vector length 224 (#vector[]/#) make for natural loops over all elements of a list or 225 vector. Below are a few examples: 226 227 <pre> 228 for i 1 10 0.1 229 echo $i 230 end 231 </pre> 232 This runs the loop with the variable #$i/# running from 1.0, 1.1, up to 9.9 233 (inclusive). 234 235 <pre> 236 for i 0 $list:n 237 echo $list:$i 238 end 239 </pre> 240 This would print all the elements of the list. 241 242 <pre> 243 for i 0 vector[] 244 echo vector[$i] 245 end 246 </pre> 247 This would print all the elements of the vector. 248 249 <p> 250 The if-block begins with a line of the form: #if (condition)/# and 251 ends with a single #end/#. A line with a single #else/# specifies the 252 optional else portion of the block. The conditional expression is a 253 valid math inequality with approximately C-syntax: 254 255 ## 256 (($i < 10) && ($i > 4)) 257 /## 258 259 The elements of the inequality may also be string comparisons. The 260 only valid string comparisons are #==/# and #!=/#. 261 262 <p> 263 The while loop begins with a line of the form #while (condition)/# and 264 ends with a single #end/#. The conditions follow the same rules as 265 the if conditional statements. 266 267 <p> 268 *continue, break, auto-break concepts/* 269 270 271 176 <tt>input (filename)</tt>. When an opihi-based program is started, it 177 loads a file from the user's home directory, with a name of the form 178 <tt>~/.programrc</tt>. This resource file may contain any commands, 179 and allows a user to customize his or her environment. 180 181 <p> 182 It is also possible to define macros which will behave much like 183 regular commands. A macro is defined by typing <tt>macro name</tt> or 184 <tt>macro create name</tt> followed by the commands. Arguments to the 185 macro are assigned to the variables $1 .. $N and the number of 186 arguments is given by $0. Macros may be defined in <tt>input</tt> 187 files. The following is a sample macro: 188 189 <pre> 272 190 macro test 273 191 echo "this is a macro" … … 281 199 282 200 <p> 283 Some of the other useful programming features are the ability to 284 run files as scripts (<tt>input (filename)</tt>) and the option of 285 performing unix system calls (<tt>exec (command)</tt>). 201 Opihi has several types of flow-control features. These include 202 for-loops, while-loops, if-else blocks. These blocks are defined by 203 the corresponding command (<tt>for</tt>, <tt>while</tt>, <tt>if</tt>) and are terminated 204 with by a line with the single word <tt>end</tt>. 205 206 <p> 207 The for-loop syntax is simplistic. The <tt>for</tt> command specifies 208 the loop variable, the starting value, the ending value, and 209 optionally the delta for each loop. The implicit loop test is always 210 to check if the loop variable is still less than the end value (or 211 greater than if the delta value is negative). The definitions of this 212 loop syntax and the value of the list length (<tt>$list:n</tt>) and 213 the vector length (<tt>vector[]</tt>) make for natural loops over all 214 elements of a list or vector. Below are a few examples: 215 216 <pre> 217 for i 1 10 0.1 218 echo $i 219 end 220 </pre> 221 This runs the loop with the variable <tt>$i</tt> running from 1.0, 1.1, up to 9.9 222 (inclusive). 223 224 <pre> 225 for i 0 $list:n 226 echo $list:$i 227 end 228 </pre> 229 This would print all the elements of the list. 230 231 <pre> 232 for i 0 vector[] 233 echo vector[$i] 234 end 235 </pre> 236 This would print all the elements of the vector. 237 238 <p> 239 The if-block begins with a line of the form: <tt>if (condition)</tt> and 240 ends with a single <tt>end</tt>. A line with a single <tt>else</tt> specifies the 241 optional else portion of the block. The conditional expression is a 242 valid math inequality with approximately C-syntax: 243 244 <pre> 245 (($i < 10) && ($i > 4)) 246 </pre> 247 248 The elements of the inequality may also be string comparisons. The 249 only valid string comparisons are <tt>==</tt> and <tt>!=</tt>. 250 251 <p> 252 The while loop begins with a line of the form <tt>while (condition)</tt> and 253 ends with a single <tt>end</tt>. The conditions follow the same rules as 254 the if conditional statements. 255 256 <em>continue, break, auto-break concepts</em> 257 286 258 287 259 <h3> Miscellaneous Commands </h3> … … 307 279 files (this includes general help not associated with a specific 308 280 command). 281 282 <em>output</em> 283 284 <em>scan</em> 309 285 310 286 <h3> 1D Data and the Graphing Window </h3>
Note:
See TracChangeset
for help on using the changeset viewer.
