02.05.2013 Views

Description - Mks.com

Description - Mks.com

Description - Mks.com

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.

To close a given file, use<br />

close filename ;<br />

The filename is given as a string-valued expression. If you use a printing statement to write to a<br />

file, it is important to close the file before cc runs a program that requires the contents of the file to<br />

be up-to-date.<br />

Delete File<br />

To delete a given file, use<br />

delete filename ;<br />

You can use this to get rid of temporary (work) files created by earlier statements in the cc<br />

program. The file name is given as a string-valued expression.<br />

Define Function<br />

You can define a function using the function statement, which has the form:<br />

function name ( [arg1{, arg2}] )<br />

{<br />

statements<br />

}<br />

Execute a <strong>com</strong>mand<br />

To execute a <strong>com</strong>mand, use<br />

exec expression { , expression } ;<br />

Each expression is converted into a string (if necessary) and then concatenated into a <strong>com</strong>mand<br />

string (with a single blank between each expression in the list). For example,<br />

exec "cp","infile","outfile" ;<br />

executes the <strong>com</strong>mand<br />

cp infile outfile<br />

The exec statement executes the <strong>com</strong>mand and then goes on to the next statement. (See the<br />

exec expression following for ways to get the return status of the executed <strong>com</strong>mand.) The<br />

behavior of exec can be changed by the values of the ECHO and NORUN variables.<br />

313 of 457

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

Saved successfully!

Ooh no, something went wrong!