Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.14 KB

literate.sh.md

File metadata and controls

50 lines (33 loc) · 1.14 KB

Shell literate example

This is an example of Shell programming, in the style promoted by Knuth called literate programming. The text is encoded using Markdown, and the programming language used is the Unix Shell.

More about literate programming:

The program

The simplest Shell program:

echo "That's all Folks!"

Fancy, doensn't it?

How to evaluate?

Simply run this command in the Shell:

$ ./run-md literate.sh.md 
>>> Running: literate.sh.md
That's all Folks!

How to publish?

Install MarkDown processors:

MANAGER=yum
which dnf >/dev/null 2>&1 && MANAGER=dnf
which apt-get >/dev/null 2>&1 && MANAGER=apt-get
sudo $MANAGER -y install pandoc texlive

and execute make build in this directory! HTML and PDF output formats are generated. Check with any HTML browser and PDF viewer:

elinks literate.sh.html
evince literate.sh.pdf

That's all Folks!