In this section, we learned about:
- Heredocs and here strings, and their similarities and differences.
- Using the
printfcommand to do string interpolation. - Using brace expansion to combine several similar commands into one line of code.
- Importing files via the
sourcecommand, and the difference betweensource fooand./foo. - How to escape code within strings using the
\escape character. - What escape characters are, and why they’re used.
- Some very basic syntax of non-Bash shells:
- How to declare a local variable in
fishandksh. - Accessing the arguments passed to a
fishshell script viaargv[]. - How to declare local variables in a
fishscript using thesetcommand. - How to print a function definition in
fishusing thefunctionscommand. - How to evaluate
fishcode inside the current process context using thesourcecommand. - The difference between
set -einfishvs. Bash - How the
functionkeyword is optional in Bash andzsh, but not infishorksh.
- How to declare a local variable in
- Why you might not want to use the
functionkeyword in your Bash orzshshells. - How to set a default value in a parameter expansion using
:-. - Why the core team was unsatisfied with RVM’s approach of overriding the
cdcommand, and decided to make shell integration optional in RBENV. - The pros and cons of using Bash,
zsh,fish, andksh, and why you might pick one over the others.