· 2 min read

Learn Shell Scripting: 39 Flashcards on Shebangs, POSIX vs Bash and the Unix Toolbox

Study shell scripting with 39 flashcards: shebang, POSIX, bash vs dash vs zsh, bashisms, pipelines, sed, awk, grep, plus the syntax cards worth adding.

Glowing terminal window, seashell and connected pipes among flashcards

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

Flip It deck OM8737 — Shell Scripting (39 cards) is less a syntax drill than a map of the shell world: what a script is, which shell runs it, which Unix tools it leans on and why big scripts eventually get rewritten in another language. Learn it as the context layer, then add the syntax yourself.

Study this deck: Shell Scripting

1 / 10
Question

Shell script

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Key cards

FrontBack (from the deck)
ShebangA comment starting with #! that tells the system which interpreter runs the script
Where must the shebang be located?The first line of the file
DashDebian Almquist shell, a minimal POSIX shell often used as /bin/sh for speed
BashismsBash-only features not in POSIX, which reduce portability
Wrapper scriptSets up the environment, runs a program, cleans up or logs
PrintfFormatted output, more portable than echo across shells
PipelineThe output of one command becomes the input of the next with the | operator
Larry Wall on portabilityIt's easier to port a shell than a shell script

What you'll cover

Shells: Bourne shell (sh), Bash, Dash, Zsh, KornShell (ksh), C shell (csh/tcsh), Fish, PowerShell (pwsh), POSIX, Cygwin. Script anatomy: shebang, # comments, .sh extension (often none), for loops, if, > redirection, dotfiles, wrapper scripts. Toolbox: ls, clear, printf, sed, awk, grep, pipelines, make, Perl, Tcl. Trade-offs: same syntax as the interactive prompt, slow process-per-command execution, typo risk (the infamous rm -rf * / with a stray space), why scripts get ported to other languages.

Two tips specific to this deck

Sort the shells on one axis: POSIX or not. sh, dash, ksh and bash (in POSIX mode) sit on one side; csh, fish and PowerShell on the other. Then tag the defaults that the cards blur: on Debian and Ubuntu /bin/sh is dash, macOS has used zsh as its login shell since Catalina (2019), and zsh's compatibility mode emulates sh/ksh, not bash (card 12). Card 14's claim that ksh was replaced by zsh is a simplification — ksh93 still ships on AIX and Solaris.

Write the syntax cards the deck leaves out. Only one operator (>) and two keywords (for, if) appear, so add about ten cards you can actually type: chmod +x, $var vs "$var" quoting, $? exit codes, [ ] / test, while, case, functions, >> and 2>&1, $(command) substitution and set -euo pipefail. Turn card 19 into a habit card too: quote variables and never run rm -rf "$dir/" without checking $dir is non-empty.

Where to find it

Open Flip It and search OM8737 in the library. For the commands your scripts will call — find, chmod, xargs, tar — continue with our Linux command line study guide.

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account