Skip to content

Commit fac6aea

Browse files
authored
Update 1443-system-exec.markdown
1 parent fe57f38 commit fac6aea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# EXEC
22

3-
> EXEC file
3+
> EXEC (file)
44
5-
Transfers control to another operating system program. Control returns to the .bas immediately and the system command is executed parallel and independent to SmallBASIC. File name is case sensitive in Linux.
5+
Transfers control to the program `file`. Control returns to the calling bas-file immediately and the program is executed parallel and independent to SmallBASIC. File name is case sensitive in Linux. Enclose the string `file` with quotation marks to start a program with parameters.
66

77
See `run` for starting an external program and wait until program finished execution.
88

9+
### Example 1
10+
911
```
1012
' Select your editor for testing
1113
exec "kate" ' Editor KDE
@@ -15,3 +17,9 @@ exec "kate" ' Editor KDE
1517
print "This line will be printed immediately without delay"
1618
```
1719

20+
### Example 2: Execute with parameters
21+
22+
```
23+
' Call shutdown in Linux
24+
exec(enclose("shutdown -h now"))
25+
```

0 commit comments

Comments
 (0)