Bash Shell ScriptΒΆ

You can upload and run a bash script in your Zuar Runner command jobs.

../_images/bash-shell-1.png

Bash, the most commonly available unix shell, is the shell, or command language interpreter, for the GNU operating system.

Bash commands can be saved in a file and executed as a script.

The following Bash script (test_bash_script.sh) creates a CSV file: written_by_bash.csv

#!/usr/bin/env bash

echo "id, name" > /var/mitto/data/written_by_bash.csv
echo "1, Allen" >> /var/mitto/data/written_by_bash.csv
echo "2, Steve" >> /var/mitto/data/written_by_bash.csv

Upload the Bash script to Zuar Runner via the file manager (in the menu on the left).

Then create a cmd job.

../_images/bash-command-line__cmd_job.png

Give it a name, and use the command from above: bash /var/mitto/data/test_bash_script.sh. Once the job is created, you can view the JSON configuration by clicking the JSON tab in the job edit window. You should see something like:

{
    "cmd": "bash /var/mitto/data/test_bash_script.sh",
    "shell": true
}

Running the job should create a file that looks like this:

../_images/bash-command-line__output.png