12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Utility Functions and CommandsAll functions return a number or string value that may be used in an expression.The return values of some functions are only of use in conditional expressions, sotheir return values are given as true or false. The corresponding number values are1and 0, re<strong>spec</strong>tively.System Functionschdir() — Changes <strong>spec</strong>’s current working directory to to the user’s home directoryas obtained from the user’s environment variable HOME. Returns true orfalse according to whether the command was successful or not. The value ofthe built-in string variable CWD is updated to the current working directory.chdir(directory) — As above, but changes to the directory directory ,which mustbe a string constant or expression.unix() — Spawns an interactive subshell using the program obtained from the user’senvironment variable SHELL (or shell ). Uses /bin/sh if the environmentvariable is not set. Returns the integer exit status of the shell.unix(command) — As above, but uses /bin/sh to execute the one-line commandcommand ,which must be a string constant or expression. Returns the integerexit status of the command.unix(command, str [, len ]) — As above, but the argument str is the name of avariable in which to place the string output from the command in the firstargument. The maximum length of the string is 4096 bytes (including a nullbyte). The optional third argument can be used to <strong>spec</strong>ify a larger size.time() — Returns the current epoch in seconds. The UNIX epoch is the number ofseconds from January 1, 1970, 00:00:00 GMT. The value returned includes afractional part with the resolution dependent on the host platform. Millisecondresolution is standard, although on 80X86 systems only hundredth of asecond resolution is returned.date() — Returns a string containing the current date asThu Jul 23 21:12:39 EDT 1992 .date(seconds) — As above, but the returned string represents the epoch given byseconds .See time() above.INTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION REFERENCE MANUAL 69

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

Saved successfully!

Ooh no, something went wrong!