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 />

Scripts can also be nested. That is, scripts can contain shell input redirections that<br />

cause the shell to process other scripts.<br />

! CAUTION: Input and output redirection must refer to files on a host file system. If<br />

you have a local file system on your target, files that reside there are available to<br />

target-resident subroutines, but not to the shell or to other <strong>Tornado</strong> tools (unless<br />

you export them from the target using NFS, and mount them on your host).<br />

! CAUTION: You should set the WindSh environment variable SH_GET_TASK_IO to<br />

off before you use redirection of input from scripts or before you copy and paste<br />

blocks of commands to the shell command line. Otherwise commands might be<br />

taken as input for a command that preceeds them, and lost.<br />

C-Interpreter Startup Scripts<br />

<strong>Tornado</strong> shell scripts can be especially useful for setting up your working<br />

environment. You can run a startup script through the shell C interpreter 5 by<br />

specifying its name with the -s command-line option to windsh. For example:<br />

% windsh -s /usr/fred/startup<br />

Like the .login or .profile files of the UNIX shells, startup scripts can be used for<br />

setting system parameters to personal preferences: defining variables, specifying<br />

the target’s working directory, and so forth. They can also be useful for tailoring<br />

the configuration of your system without having to rebuild VxWorks. For example:<br />

■<br />

creating additional devices<br />

■<br />

loading and starting up application modules<br />

■<br />

adding a complete set of network host names and routes<br />

■<br />

setting NFS parameters and mounting NFS partitions<br />

For additional information on initialization scripts, see 5.7 Tcl: Shell Interpretation,<br />

p.198.<br />

5. You can also use the -e option to run a Tcl expression at startup, or place Tcl initialization in<br />

.wind/windsh.tcl under your home directory. See 5.7.3 Tcl: <strong>Tornado</strong> Shell lnitialization, p.201.<br />

190

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

Saved successfully!

Ooh no, something went wrong!