Socket
Book a DemoInstallSign in
Socket

@saltcorn/bash

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saltcorn/bash

Run bash actions in Saltcorn

latest
Source
npmnpm
Version
0.2.5
Version published
Maintainers
2
Created
Source

bash

Run bash actions in Saltcorn

The run_bash_script action allows you to run shell code. It used to be restricted to bash scripts, but you can now use any shell interpreter (including Python).

Setting the shell interpreter

If you want to use a different shell interpreter than bash, you can set the first line to a shebang

Accessing the row

If the action is run against a specific row (e.g. as a button in List or Show views, or Insert/Update triggers), the fields are used to set environment variables. These are named ROW_{field name in upper case}. For instance, if the row contains a field called name then the environment variable ROW_NAME will be set. To access this in a bash script you should proceeded by a dollar sign ($), for instance:

echo $ROW_NAME

Accessing the user

The environment variables SC_USER_ID and SC_USER_ROLE are set to the user ID and the user's role ID, respectively

In workflows

To use this in workflows you use environment variables to access variables in the context. You cannot use interpolation in the code as this might conflict with your chosen shell interpreter.

After the action has completed, the following variables will be set in the context

  • exitcode: the exit code as a number
  • stdout: the process standard output
  • stderr: the process standard error

FAQs

Package last updated on 09 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts