Skip to content

Latest commit

 

History

History
271 lines (259 loc) · 33.8 KB

File metadata and controls

271 lines (259 loc) · 33.8 KB
title Unix Shell

Use Warp as my terminal & Zsh as my shell. Fish & Oil seem like great shell alternatives. Pipr seems useful.

ShellCheck is great for linting scripts. How Warp works is a great read. sh is nice Go lib to parse Shell code.

rc shell from Plan 9 OS is interesting too.

fzf, Atuin & shell2http are great additions to the shell.

Variables

All active variables can be seen by running env.

  • $HOME - Expands to the path of my home folder.
  • $PS1 - Variable that represents my command prompt line.
  • $PATH - Special environment variable that contains the command path (list of system directories that the shell searches when trying to locate a command).

Notes

  • Scripts are run in subshells, and nothing is shared "upwards". That's the difference between running a script and sourcing one. A sourced (imported) script is run in your own script's namespace.
  • In shell everything is a string.
  • Children never touch parent environment. It can only if it runs as part of the current process (source, function, alias).
  • Pipes are used to connect one process's output with another process’s input.
  • /etc/paths.d define paths to add to $PATH globally to all users.

Links