Edit this page on our live server and create a PR by running command !create-pr in the console panel

Working with Bash and Zsh

  • Difficulty level: easy
  • Time need to lean: 10 minutes or less
  • Key points
    • SoS works with Bash through either the bash kernel or the Calysto_bash kernel.
    • SoS works with Zsh through the zsh-jupyter-kernel.
    • The kernel interprets content of the cell as bash or zsh scripts
    • Limited data exchange is supported because bash or zsh does not have a rich type system as Python

Bash

The Bash kernel is not rich in data types and everything is essentially a string. You can pass primitive datatypes from SoS to Bash but expect to get string representation of variables out of it.

In [1]:
Hello World

In [2]:
In [3]:
Hello Bash

In [4]:
Hello Bash

In [5]:
Hello from Bash

In [6]:
Out[6]:
'Hello from Bash'

Zsh

The usage of the zsh kernel is identical to bash.

In [7]:
Hello World
In [8]:
In [9]:
Hello Zsh
In [10]:
Hello Zsh
In [11]:
Hello from Zsh
In [12]:
Out[12]:
'Hello from Zsh'