Helper scripts

When bootstrapping any sandbox container or virtual machine, we inject a couple of helper scripts. These functions assist you in setting up the environment, or when writing check scripts. You can view the currently available set of scripts here:

These helper scripts assume the container or virtual machine have a POSIX shell available at /bin/sh.


The fail-message script can be used to provide feedback to the learner when writing check scripts. The function will write a given string to stdout, prefixed with FAIL:. See Challenge check for more details on writing check scripts.

# check
echo "Checking the solution of the challenge"
fail-message "Your challenge failed because of [REASON]"
# which is equivalent to
echo "FAIL: Your challenge failed because of [REASON]"
exit 1


The set-workdir script can be used to change the active working directory for a terminal tab.

The set-workdir script is implemented using $HOME/.bashrc. This means you'll have to use bash as the shell for the container or virtual machine.

If you don't have bash available, you can achieve the same behavior by adding a cd /path/to/workdir command to the shell's profile (e.g. $HOME/.profile or /etc/profile).

When using the ash shell (which most busybox based containers do), you can also indicate that the .bashrc profile needs to be loaded. To do so, add an environment variable ENV with value $HOME/.bashrc. to the container's environment variables in the config.yml.