Shell variables¶
Display of all shell variables¶
[1]:
!set
!=0
'#'=0
'$'=29997
'*'=( )
-=569X
0=/bin/zsh
'?'=0
@=( )
ARGC=0
CDPATH=''
CLICOLOR=1
CLICOLOR_FORCE=1
COLUMNS=80
CPPFLAGS=-I/opt/homebrew/opt/libomp/include
CPUTYPE=arm64
EGID=20
EUID=501
FIGNORE=''
FORCE_COLOR=1
FPATH=/opt/homebrew/share/zsh/site-functions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.9/functions:/Users/veit/.zfunc
FUNCNEST=700
GID=20
GIT_PAGER=cat
HISTCHARS='!^#'
HISTCMD=0
HISTSIZE=30
HOME=/Users/veit
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_NO_ANALYTICS=1
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_REPOSITORY=/opt/homebrew
HOST=fay.local
IFS=$' \t\n\C-@'
INFOPATH=/opt/homebrew/share/info:
JPY_PARENT_PID=92198
JPY_SESSION_NAME=/Users/veit/cusy/trn/Python4DataScience/docs/workspace/ipython/unix-shell/shell-variables.ipynb
KEYBOARD_HACK=''
KEYTIMEOUT=40
LC_CTYPE=UTF-8
LDFLAGS=-L/opt/homebrew/opt/libomp/lib
LINENO=1
LINES=24
LISTMAX=100
LOGNAME=veit
LaunchInstanceID=3B58B71F-E402-40DE-883C-664B9838C83A
MACHTYPE=x86_64
MAILCHECK=60
MAILPATH=''
MANPATH=''
MODULE_PATH=/usr/lib/zsh/5.9
MPLBACKEND=module://matplotlib_inline.backend_inline
NULLCMD=cat
OLDPWD=/Users/veit/cusy/trn/Python4DataScience/docs/workspace/ipython/unix-shell
OPTARG=''
OPTIND=1
OSTYPE=darwin24.0
PAGER=cat
PATH=/Users/veit/cusy/trn/Python4DataScience/.venv/bin:/Users/veit/.local/bin:/Users/veit/.cargo/bin:/Users/veit/spack/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew//lib/ruby/gems/3.3.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/veit/.lmstudio/bin
PPID=29994
PROMPT=''
PROMPT2=''
PROMPT3='?# '
PROMPT4='+%N:%i> '
PS1=''
PS2=''
PS3='?# '
PS4='+%N:%i> '
PSVAR=''
PWD=/Users/veit/cusy/trn/Python4DataScience/docs/workspace/ipython/unix-shell
PYDEVD_USE_FRAME_EVAL=NO
RANDOM=25357
READNULLCMD=more
SAVEHIST=0
SECONDS=0
SECURITYSESSIONID=186b1
SHELL=/bin/zsh
SHLVL=2
SPACK_PYTHON=/opt/homebrew/bin/python3
SPACK_ROOT=/Users/veit/spack
SPROMPT='zsh: correct '\''%R'\'' to '\''%r'\'' [nyae]? '
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.YA3uoh9GcT/Listeners
TERM=xterm-color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=455.1
TERM_SESSION_ID=91C8B4C6-9710-438B-BB3A-7AFFCDE0F900
TIMEFMT='%J %U user %S system %P cpu %*E total'
TMPDIR=/var/folders/hk/s8m0bblj0g10hw885gld52mc0000gn/T/
TMPPREFIX=/tmp/zsh
TRY_BLOCK_ERROR=-1
TRY_BLOCK_INTERRUPT=-1
TTY=/dev/ttys098
TTYIDLE=0
UID=501
USER=veit
USERNAME=veit
UV=/Users/veit/.local/bin/uv
UV_RUN_RECURSION_DEPTH=1
VENDOR=apple
VIRTUAL_ENV=/Users/veit/cusy/trn/Python4DataScience/.venv
WATCH
WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>'
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
ZSH_ARGZERO=/bin/zsh
ZSH_EVAL_CONTEXT=cmdarg
ZSH_EXECUTION_STRING=set
ZSH_NAME=zsh
ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
ZSH_SUBSHELL=0
ZSH_VERSION=5.9
_=set
__CFBundleIdentifier=com.apple.Terminal
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
aliases
argv=( )
builtins
cdpath=( )
commands
dirstack
dis_aliases
dis_builtins
dis_functions
dis_functions_source
dis_galiases
dis_patchars
dis_reswords
dis_saliases
fignore=( )
fpath=( /opt/homebrew/share/zsh/site-functions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.9/functions /Users/veit/.zfunc )
funcfiletrace
funcsourcetrace
funcstack
functions
functions_source
functrace
galiases
histchars='!^#'
history
historywords
jobdirs
jobstates
jobtexts
keymaps
mailpath=( )
manpath=( )
module_path=( /usr/lib/zsh/5.9 )
modules
nameddirs
options
parameters
patchars
path=( /Users/veit/cusy/trn/Python4DataScience/.venv/bin /Users/veit/.local/bin /Users/veit/.cargo/bin /Users/veit/spack/bin /opt/homebrew/opt/ruby/bin /opt/homebrew//lib/ruby/gems/3.3.0/bin /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /System/Cryptexes/App/usr/bin /usr/bin /bin /usr/sbin /sbin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin /Library/Apple/usr/bin /usr/local/MacGPG2/bin /Library/TeX/texbin /Users/veit/.lmstudio/bin )
pipestatus=( )
prompt=''
psvar=( )
reswords
saliases
signals=( EXIT HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH INFO USR1 USR2 ZERR DEBUG )
status=0
termcap
terminfo
userdirs
usergroups
watch
widgets
zsh_eval_context=( cmdarg )
zsh_scheduled_events
Showing the value of a variable¶
[2]:
!echo $HOME
/Users/veit
The path variable¶
It defines the shell’s search path, i.e., the list of directories that the shell looks in for runnable programs.
[3]:
!echo $PATH
/Users/veit/cusy/trn/Python4DataScience/.venv/bin:/Users/veit/.local/bin:/Users/veit/.cargo/bin:/Users/veit/spack/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew//lib/ruby/gems/3.3.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/veit/.lmstudio/bin
Creating and changing variables¶
Creating or overwriting variables¶
[4]:
!export SPACK_ROOT=~/spack
Append additional specifications¶
[5]:
!export PATH=/usr/local/opt/python@3.13/bin:$PATH