02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

User’s Guide<br />

int<br />

)<br />

-> taskSpawn<br />

arg10<br />

Meta-characters<br />

Some characters have special meanings to the shell:<br />

? When used alone, this meta-character acts as a toggle to switch between the C and Tcl<br />

interpreters. In the C interpreter context, if the question mark is followed by text, that<br />

text is interpreted as a Tcl expression, but without entering the Tcl mode. For<br />

example:<br />

@<br />

-> ? wtxAgentModeGet<br />

AGENT_MODE_TASK<br />

This meta-character forces the C interpreter to treat the word that follows as a target<br />

symbol. This is useful when a target function has the same name as a shell built-in<br />

function. For example:<br />

-> @d<br />

> This meta-character redirects C-interpreter output. For example:<br />

-> moduleShow >/tmp/loaded<br />

< This meta-character redirects C-interpreter input.<br />

-> < myOwnCommandFile<br />

Standard Input and Output<br />

Developers often call routines that display data on standard output, or accept data from<br />

standard input. By default the standard output and input streams are redirected to the<br />

same window as WindSh. For example, in a default configuration of <strong>Tornado</strong>, the<br />

following is what see in the shell window from a printf( ) invocation:<br />

-> printf ("Hello World!\n")<br />

Hello World!<br />

value = 13 = 0xd<br />

-><br />

This behavior can be dynamically modified using the shConfig Tcl procedure:<br />

-> ?shConfig SH_GET_TASK_IO off<br />

-><br />

-> printf ("Hello World!\n")<br />

value = 13 = 0xd<br />

-><br />

The shell duly reports the printf( ) result, indicating that 13 characters were printed. But<br />

the output itself goes elsewhere by default.<br />

372

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

Saved successfully!

Ooh no, something went wrong!