System Commands

A few system commands can be used within the interpreter. They are like functions but when they are called the arguments don't need to be included in brackets.

sysem: execute an operating system command
>> system "cmd.exe";
The command prompt window will pop up.

pwd: show current working directory. Takes no argument
>> pwd;
   G:\xlab07\windows\

cd: change current working directory. Takes one argument, which is the directory to be changed to (a quoted string).
>> cd "..";
>> cd "secrets";
In Windows, absolute path starts with the drive letter followed by a colon. To change current drive to D, do
>> cd "D:";

ls: list files in current working directory. Works the same way as the shell command ls, but it doesn't take arguments.

clear: clear the screen.

cat: print contents of a file.
>> cat "boot.ini";
The contents of file boot.ini will be printed out in the command window.

exit: close the interpreter program. Takes no argument.

help: displays a help message on a given topic. Takes one argument (the help subject).

>> help "while"

oz 2009-12-22