Execute Shell Command (vuo.app.shell)

Runs a command in a Unix shell.

Command can either be the shell command itself (e.g., echo hi), or it can be a path to a shell script or a command-line executable.

The command runs in a sandbox that permits accessing the network, and reading and writing files in the system’s temporary folder (/private/tmp/). It prohibits reading and writing files anywhere in the user’s home folder. For that reason, this node can’t run most Mac apps with a graphical user interface — use the Launch App node for Mac apps.

This node waits for the command to finish executing, then provides its standard output and standard error streams (the text Output port) and its exit code (Status).

Script interpreters

By default, this node uses BASH to interpret the command. You can use another interpreter by starting the script with a line containing #! and the path to the interpreter.

Languages included with macOS

AppleScript:

#!/usr/bin/osascript
display dialog "Hello from AppleScript!"

JavaScript:

#!/usr/bin/osascript -l JavaScript
console.log("Hello from JavaScript!")

Additional languages

You can install Homebrew, then use Homebrew to install other language interpreters, and use them with Vuo:

CLISP:

#!/opt/homebrew/opt/clisp/bin/clisp
(print "Hello from Lisp!")

Gravity:

#!/opt/homebrew/opt/gravity/bin/gravity
func main() {
    System.print("Hello from Gravity!");
    return true;
}

Haskell:

#!/usr/bin/env PATH=/opt/homebrew/opt/ghc/bin runhaskell
main = putStrLn "Hello from Haskell!"

Lua:

#!/opt/homebrew/opt/lua/bin/lua
print "Hello from Lua!"

node.js:

#!/opt/homebrew/opt/node/bin/node
console.log("Hello from node.js!");

OCaml:

#!/usr/bin/env PATH=/opt/homebrew/opt/ocaml/bin ocaml
print_string "Hello from OCaml!";;

PHP:

#!/opt/homebrew/opt/php/bin/php
<?php
echo "Hello from PHP!";

Python 3:

#!/opt/homebrew/opt/python3/bin/python3
print("Hello from Python!")

Ruby:

#!/opt/homebrew/opt/ruby/bin/ruby
print "Hello from Ruby!"

Wren

#!/opt/homebrew/opt/wren-cli/bin/wren_cli
System.print("Hello from Wren!")

Keywords: $(), AppleScript, BASH, CLISP, Gravity, Haskell, JavaScript, Lisp, Lua, OCaml, PHP, Perl, Python, Ruby, Terminal, Unix, Wren, ``, cURL, cli, command line, console, node.js, script, system, text code


Example composition:


Back to vuo.app node set documentation.