In this section, we learned about:
- Heredocs and here strings, and their similarities and differences.
- Using the
printf
command to do string interpolation. - Using brace expansion to combine several similar commands into one line of code.
- Importing files via the
source
command, and the difference betweensource foo
and./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
fish
andksh
. - Accessing the arguments passed to a
fish
shell script viaargv[]
. - How to declare local variables in a
fish
script using theset
command. - How to print a function definition in
fish
using thefunctions
command. - How to evaluate
fish
code inside the current process context using thesource
command. - The difference between
set -e
infish
vs. Bash - How the
function
keyword is optional in Bash andzsh
, but not infish
orksh
.
- How to declare a local variable in
- Why you might not want to use the
function
keyword in your Bash orzsh
shells. - How to set a default value in a parameter expansion using
:-
. - Why the core team was unsatisfied with RVM’s approach of overriding the
cd
command, 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.