Shell-Variablen#

Anzeige aller Shell-Variablen#

[1]:
!set
BASH=/usr/local/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_EXECUTION_STRING=set
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="5" [1]="0" [2]="16" [3]="1" [4]="release" [5]="x86_64-apple-darwin19.3.0")
BASH_VERSION='5.0.16(1)-release'
CLICOLOR=1
CPPFLAGS=-I/usr/local/opt/openblas/include
DIRSTACK=()
DISPLAY=/private/tmp/com.apple.launchd.WfrReZHn7e/org.macosforge.xquartz:0
…

Anzeigen des Wertes einer Variablen#

[2]:
!echo $HOME
/Users/veit

Die path-Variable#

Sie definiert den Suchpfad der Shell, d.h. die Liste der Verzeichnisse, in denen die Shell nach ausführbaren Programmen sucht.

[1]:
!echo $PATH
/Users/veit/.local/share/virtualenvs/jupyter-tutorial-G-MBNaSt/bin:/Users/veit/Library/Python/3.7/bin:/Users/veit/spack/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Library/Apple/usr/bin

Erstellen und Ändern von Variablen#

Anlegen oder Überschreiben von Variablen#

[3]:
!export SPACK_ROOT=~/spack

Zusätzliche Spezifikationen anhängen#

[5]:
!export PATH=/usr/local/opt/python@3.7/bin:$PATH