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.
You can also use variables inside file
cells, which allow you to use notebooks for your custom content.
USER={{bar}}
cat myfile.txt
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"
```
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}}