Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.36 KB

variables.md

File metadata and controls

54 lines (38 loc) · 1.36 KB

Using variables

This runs successfully if you have created a variable called foo.

echo "{{foo}} world"

If bar is not defined, an error will be displayed.

echo "hello {{bar}}"

Define bar in the box at the top of the page and try to run again. You can also manage variables available in any notebook at /variables.

Create file with variable content.

You can also use variables inside file cells, which allow you to use notebooks for your custom content.

USER={{bar}}
cat myfile.txt

Defining variables

To declare a variable, simply provide the name in a comma-seperated list. Then inside the cell body, you can refer to the variable using {{variable-name}}.

```bash|{type:'command', variables: 'foo, bar'}
echo "{{foo}} world"
```

Secret variables

For sensitive variables, such as passwords, tokens, and ssh keys, you can check the "Secret" checkbox. While all variables are encrpyted when stored on server, when marked secret, they will be masked when displayed in output.

echo {{secret_token}}