Node:Passing Commands to the OS, Next:Keeping track of Time, Previous:Threading Words, Up:Words
Gforth allows you to pass an arbitrary string to the host operating
system shell (if such a thing exists) for execution.
Parse a string and use
sh"..." -- gforth ``sh''
systemto pass it to the host operating system for execution in a sub-shell.
Pass the string specified by c-addr u to the host operating system for execution in a sub-shell.
systemc-addr u -- gforth ``system''
$?-- n gforth ``dollar-question''
Value- the exit status returned by the most recently executed
The string c-addr1 u1 specifies an environment variable. The string c-addr2 u2 is the host operating system's expansion of that environment variable. If the environment variable does not exist, c-addr2 u2 specifies a string 0 characters in length.
getenvc-addr1 u1 -- c-addr2 u2 gforth ``getenv''