/sh

Various shell scripts

Primary LanguageShell

Sh - (POSIX) Shell scripts

How to use the preprocessor

You might notice that some of the shell scripts use code as follows:

#!import module.function
#!import module.*

This means that it uses the pp processor, found in pp.c. This preprocessor imports functions from a <shell-source>.m file so that they are available in the preprocessed output.

Compilation

cc -o pp pp.c # or: make pp

Usage

Usage: pp [-hv] [-o OUTFILE] [INFILE...]
  -h   Show this message and exit.
  -v   Enable verbose output.
  -o   Use custom output name instead of default 'outfile'.

Example

# The following creates out/pushbak.sh from the script utils/pushbak.sh and the module commands.m
pp -o out/pushbak.sh utils/pushbak.sh commands.m # all module files has to be specified, and must end in '.m'