Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Github repo cloud-examples: https://github.com/sagemath/cloud-examples

Views: 7955
License: MIT

bash jupyter kernel in sage worksheet

Features shown:

  • remember variables and working directory between cells

  • ansi colors displayed in output

  • display images by sending file to stdin for display command

  • autocompletion

%auto jbash = jupyter("bash") %default_mode jbash
[removed]
set | grep SHELL
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
pwd echo ls
/projects/ccd4d4a4-29a8-4c39-85c2-a630cb1e9b6c/cloud-examples/sagews-jupyter

bash.sagews  jupyter-python3.sagews  r-completion.png  r.sagews  sage.png
# display an image display < sage.png
# set variables and working directory in a cell VAR1='hello' VAR2='world' cd ..
# verify variables and working directory in next cell pwd echo echo $VAR1 $VAR2
/projects/ccd4d4a4-29a8-4c39-85c2-a630cb1e9b6c/cloud-examples

hello world
# autocompletion # put cursor at the end of VAR and type TAB echo $VAR