Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shell (Bash and Zsh) Notes

Scripting CLI #shell #bash #zsh #scripting #best practices #til

Don’t use ~ in scripts; use $HOME

I have used ~ several times in scripts, but it may not always expand as expected depending on the environment. Use $HOME to refer to the home directory; it is much more reliable and always works.