system

From the SETL Wiki

Jump to: navigation, search
system
Category I/O
Syntax function
Compatibility
CIMS SETL no
SETL-S no
SETL2 no
GNU SETL yes

Contents

Purpose

Execute a command via the system shell

Synopsis

 system(cmd)

Description

Executes the given command using the posix function system(). Returns the subprocess exit code, and also stores it in the system variable status. Since the command is executed via the shell it may use shell syntax e.g. environment variable expansion.

Examples

  1. system('mkdir abc');
    

    Invoke the unix 'mkdir' command to create a directory named 'abc', returning zero if successful.

  2. system('$EDITOR foo.txt');
    

    Invoke the user's default editor to edit the file 'foo.txt'

Personal tools