execute given shell command
Parameters
execute command :string
Attributes
args
:block
use given command arguments
async
execute asynchronously as a process and return id
code
return process exit code
directly
execute command directly, as a shell command
Returns
Examples
copy
print execute "pwd"
; /Users/admin/Desktop
split.lines execute "ls"
; => ["tests" "var" "data.txt"]
copy
execute.args: ["-s"] "ls"
; => total 15
; 0 aoc
; 0 architectures
; 4 bundle
; 0 cave
; 4 cmd.c
; 1 expr.art
; 0 galilee
; 4 generic_klist.c
; 1 jquery.js
; 0 shell
; 1 test.art
copy
execute.code "ls"
; => [output:aoc
; architectures
; bundle
; cave
; cmd.c
; expr.art
; galilee
; generic_klist.c
; jquery.js
; shell
; test.art
; code:0]
copy
; This prints the output directly
; And only returns the exit code.
execute.code.directly "ls"
aoc bundle cmd.c galilee jquery.js test.art
architectures cave expr.art generic_klist.c shell
=> 0
Related