Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

eric-brechemier/learn-shell-from-source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn Shell from Source

The Saga of Code is a series of experiments for programmers to learn a language by:

  1. reading an authoritative specification and writing short examples of code to illustrate the specification

  2. running the examples using an open source implementation and reading the source code to understand observed behaviors

In the first episode of the series, I learn Unix Shell programming from POSIX Shell and Utilities specification and the source code of DASH.

RUNNING EXAMPLES

You can find the example shell scripts grouped by topic in the folder examples. You can run each example with dash or the standard interpreter sh already installed on your system.

The dash executable can be run from dash/src/dash in this project, it is already present in the git repository. If you wish to recompile it, delete the file and follow the procedure below.

COMPILING DASH

# from the root of this project
cd dash
./autogen.sh
./configure
make

If you wish to delete the temporary files generated by the build (and not already part of the git repository), you can run git clean to remove all untracked files and repositories:

# make sure that you run this command in the expected repository
pwd

# dry-run: check which files and directories will be deleted
git clean -f -d -n

# delete untracked files and repositories
git clean -f -d

RECOMMENDED READING ORDER

The POSIX specification is intended for implementers rather than users of the Shell programming language. It describes border cases, parsing tokens and undefined effects left to the freedom of the implementer in minute details without providing an overview of the language.

I recommend the following reading order to start with the most general aspects of the language and uncover finer details step by step:

AUTHOR

Eric Bréchemier
github@eric.brechemier.name

LICENSE

CC0
https://creativecommons.org/publicdomain/zero/1.0/

About

The Saga of Code Episode 1: learn Unix Shell programming from POSIX Shell and Utilities specification and the source code of DASH

Topics

Resources

License

Stars

Watchers

Forks

Contributors