コンテンツにスキップ

Run Script

このコンテンツはまだ日本語訳がありません。

Run a script using various shells.

Spawns a child process of the shell and executes the script in it.

PortDescription
Shell
The shell to use to run the script. Check the addendum below for more information.
Script
The script to run.
Args
Arguments to pass to the script.
Stdin
Stream to pass to the scripts stdin.
Print
Option to capture the print to the stdout, to the output of the node or both.
Environment Vars
Environment variables to pass to the script.
PortDescription
Success
Error
Output
Exit Code

Python is a high-level, interpreted programming language that is widely used for general-purpose programming. It is available by default on most systems. Python scripts can be run using the python command.

In order to determine which Python installation is used, actrun will first look for an executable named python3 and then python. Any subsequent node run with this shell will use the same Python interpreter, no matter if the PATH environment variable changes after the first Run node is executed. If no Python installation is found, the node will fail with an error message.

In order to use a specific Python version, it is recommended to use the Run Executable node with the full path to the Python executable.

If you need to install a specific Python version, check out the Python Downloads page.

How to print a hello world
print("Hello, World!")

Bash s available by default on Linux and macOS systems. Bash (bash.exe) isn’t included by default on Windows.

There are multiple ways to install Bash on Windows. Once you install one of the packages below, actrun can use it to run scripts.

After the installation of a package below, you might need to restart your terminal or process in order for actrun picking up the new location of the Bash shell.

  • MinGW: A native Windows port of the GNU Compiler Collection. It includes a Bash shell.

  • Msys2: A collection of tools and libraries providing a Unix-like environment on Windows. It includes a Bash shell.

  • Git for Windows While we don’t need really Git for actrun, it comes with a Bash shell that we can use.

  • Cygwin: An extensive collection of tools from the Unix world, including a Bash shell, that can be run on Windows. Should only be used if you need more than just a Bash shell.

How to print a hello world
echo "Hello, World!"

Powershell is a shell originally developed by Microsoft for task automation and configuration management. The first 5 versions were simply called Windows PowerShell powershell.exe and the latest one is available by default on Windows systems.

The newer version v6 and higher is called PowerShell Core (pwsh.exe) and needs to be installed manually, on Linux, macOS and for some reason even on Windows 🤷‍♂️.

To use PowerShell Core on Windows, you can download it from GitHub Releases or via the unnecessarily complicated installation procedure on Microsoft.com.

Alternatively just execute the two commands below in your terminal and you’re good to go.

Terminal window
winget search Microsoft.PowerShell
winget install --id Microsoft.PowerShell --source winget
How to print a hello world
Write-Host "Hello, World!"

ID: core/run@v1