Execute a system command

Revision as of 02:42, 1 February 2007 by MikeMol (talk | contribs) (Added language categories.)

In this task, the goal is to run either the ls system command, or the pause system command.

Task
Execute a system command
You are encouraged to solve this task according to the task description, using any language you may know.

C++

Compiler: Visual C++ 2005

system("pause");

Perl

Note the use of grave quotes instead of "normal" single quotes.

`ls`

UNIX Shell

UNIX shells are designed to run system commands as a default operation.

ls

If one wants to capture the command's standard output:

CAPTUREDOUTPUT=$(ls)