Verified Commit 179a471e authored by doshitan's avatar doshitan
Browse files

Add Greg's Wiki to shell page

parent a0c77275
......@@ -204,12 +204,12 @@ set -e
At the top of the script can help with that. There are [[][many flags]] to explore.
Some common ones:
- ~-e~: causes the shell to exit immediately if a command returns a non-zero
status, though it's [[][not perfect]]
- ~-x~: echo each command before it runs it, like ~make~, often useful in CI
scripts when you want to be able to inspect what it's running
- ~-u~: treats unset variables and parameters as errors, so if you expect
something to be set or require a positional argument by referencing say ~$2~,
this helps avoid continuing running without it
this helps avoid continuing running without it, [[][some discussion on it]]
A full loaded line like:
......@@ -401,11 +401,16 @@ the shell (or @@html:<kbd>Ctrl-d</kbd>@@).
a no-op on occasion or a quick way to ignore the failure of a command
(~command || :~), but often using ~true~ is more readable.
* More resources
- [[][Greg's Wiki]] is a great resource, includes a [[][Bash FAQ]], [[][common
pitfalls]], [[][learning guide]], [[][reference sheet]], and more.
- The [[][Bash Hackers Wiki]] is a wonderful reference. Skim it, pick something you
don't recognize and learn about it.
- The [[][Advanced Bash-Scripting Guide]] is a solid introductory text if you are just
getting started shell scripting and want something structured to read. But
also a ton of advanced topics, *with examples*, and reference material.
- The [[][Advanced Bash-Scripting Guide]] can be a solid reference, I often find
myself there, but it hasn't been updated in a while, and [[][some discourage using
it]] as it can show some outdated/unsafe/buggy approaches, so best to refer to
once you know how to filter out the junk. But it covers a ton of advanced
topics, *with examples*, and makes reasonable reference material.
- It depends on your system, but the man page for your shell will either be
helpful or only something for masochists, try ~man bash~.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment