02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

For the first two problems (control structures, or display and manipulation of<br />

types that are not supported in the shell), you might also consider writing auxiliary<br />

subroutines to provide these services during development; you can call such<br />

subroutines at will from the shell, and later omit them from your final application.<br />

5.3.12 C-Interpreter Primitives<br />

Table 5-13 lists all the primitives (commands) built into WindSh. Because the shell<br />

tries to find a primitive first before attempting to call a target subroutine, it is best<br />

to avoid these names in the target code. If you do have a name conflict, however,<br />

you can force the shell to call a target routine instead of an identically-named<br />

primitive by prefacing the subroutine call with the character @. See Resolving Name<br />

Conflicts between Host and Target, p.168.<br />

5.3.13 Terminal Control Characters<br />

When you start a shell from the launcher, the launcher creates a new xterm<br />

window for the shell. The terminal control characters available in that window<br />

match whatever you are used to in your UNIX shells. You can specify all but one<br />

of these control characters (as shown in Table 5-14); see your host documentation<br />

for the UNIX command stty.<br />

When you start the shell from the UNIX command line, it inherits standard input<br />

and output (and the associated stty settings) from the parent UNIX shell.<br />

Table 5-14 lists special terminal characters frequently used for shell control. For<br />

more information on the use of these characters, see 5.5 Shell Line Editing, p.193<br />

and 5.2.7 Interrupting a Shell Command, p.173.<br />

5.3.14 Redirection in the C Interpreter<br />

The shell provides a redirection mechanism for momentarily reassigning the<br />

standard input and standard output file descriptors just for the duration of the<br />

parse and evaluation of an input line. The redirection is indicated by the < and ><br />

symbols followed by file names, at the very end of an input line. No other syntactic<br />

elements may follow the redirection specifications. The redirections are in effect for<br />

all subroutine calls on the line.<br />

For example, the following input line sets standard input to the file named input<br />

and standard output to the file named output during the execution of copy( ):<br />

186

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!