The Bash kernel runs code cells as Bash commands in a persistent Bash shell:
In [1]:
df -H
In [2]:
which python
You can define variables that are persistent for the life of the kernel:
In [3]:
project="Jupyter"
In [4]:
echo "Hello to the $project project from $BASH"
Tab completion works:
In [5]:
e
You can define bash functions and use them in later cells. Here is a function that takes images over stdin and displays the in the notebook using the display architecture.
In [6]:
display ()
{
TMPFILE=$(mktemp ${TMPDIR-/tmp}/bash_kernel.XXXXXXXXXX);
cat > $TMPFILE;
echo "bash_kernel: saved image data to: $TMPFILE" 1>&2
}
Here is an image from the Sloan Digital Sky Survey that is piped through the Jupyter display architecture:
In [7]:
cat images/sdss-galaxy.png | display