fn: system
[contents]

Contents

Syntax

The syntax for sys/system calls is:

f++:  
sys{options}(string)
system{options}(string)

n++:  
@sys{options}(string)
@system{options}(string)

Description

The sys/system function is for executing system calls/commands, it either:

  • takes a single string parameter which is the system call/command to execute; or
  • takes zero parameters and the call is followed by a code-block to execute

Options

The following options are available for sys/system calls:

option description
content add content file path of file being built as first input parameter to script/program
console print script output to console
inject inject in to file being built after parsing with language call is made from
!o do not add script output to file being built
pb parse code-block following call before saving to script path for running
raw inject in to file being built raw
!ret do not return script/program return value
option description

f++ example

Examples of system being used with f++:

system("ls *.txt")
system("./script.rb")

system
{
	x=10
	echo $x
}

n++ example

Examples of system being used with n++:

@system("ls *.txt")
@system("./script.rb")

@system
{
	x=10
	echo $x
}