execline: a small scripting language
Keywords: execline script scripting language shell embedded chain loading bernstein chaining unix

Software
skarnet.org

# execline

## What is it ?

execline is a (non-interactive) scripting language, like `sh` ; but its syntax is quite different from a traditional shell syntax. The `execlineb` program is meant to be used as an interpreter for a text file; the other commands are essentially useful inside an `execlineb` script.

execline is as powerful as a shell: it features conditional loops, getopt-style option handling, filename globbing, and more. Meanwhile, its syntax is far more logic and predictable than the shell's syntax, and has no security issues.

- The execline design and grammar
- Why not just use `/bin/sh` ?

## Installation

### Requirements

- A POSIX-compliant system with a standard C development environment
- GNU make, version 4.0 or later. Please be aware that execline will not build with an earlier version.
- skalibs version 2.3.6.1 or later. It's a build-time requirement. It's also a run-time requirement if you link against the shared version of the skalibs library.

### Licensing

execline is free software. It is available under the ISC license.

### Download

- The current released version of execline is 2.1.3.1.
- Alternatively, you can checkout a copy of the execline git repository:

       git clone git://git.skarnet.org/execline

### Compilation

- See the enclosed INSTALL file for installation details.

### Upgrade notes

- This page lists the differences to be aware of between the previous versions of execline and the current one.

## Special note

Before version 2.0.0.0, execline used the slashpackage convention by default. This is not the case anymore; nevertheless, the examples in this documentation still use `#!/command/execlineb` as their shebang line, and assume that the execline binaries are available in `/command`. Adapt them according to your installation: the shebang lines for your system might be something like `#!/bin/execlineb`, or `#!/usr/bin/execlineb`, or `#!/usr/local/bin/execlineb`, or something else entirely.

## Reference

### Commands

All these commands exit 111 if they encounter a temporary error, and 100 if they encounter a permanent error - such as a misuse.

(Script parser / launcher)

- The `execlineb` program

(Process state control)

- The `cd` program
- The `umask` program
- The `emptyenv` program
- The `export` program
- The `unexport` program
- The `fdclose` program
- The `fdblock` program
- The `fdmove` program
- The `fdswap` program
- The `fdreserve` program
- The `redirfd` program
- The `piperw` program
- The `heredoc` program
- The `pipeline` program
- The `wait` program
- The `getpid` program
- The `exec` program
- The `tryexec` program
- The `exit` program
- The `trap` program

(Basic block management)

- The `foreground` program
- The `background` program
- The `if` program
- The `ifelse` program
- The `ifte` program
- The `ifthenelse` program
- The `backtick` program
- The `runblock` program

(Variable management)

- The `define` program
- The `importas` program
- The `import` program
- The `elglob` program
- The `elgetpositionals` program
- The `multidefine` program
- The `multisubstitute` program

(Loops)

- The `forx` program
- The `forstdin` program
- The `forbacktickx` program
- The `loopwhilex` program

(Positional parameters and options management)

- The `elgetopt` program
- The `shift` program
- The `dollarat` program

(Miscellaneous)

- The `homeof` program

### Provided scripts: example `.profile` replacement

- The `execline-shell` script
- The `execline-startup` script

### Fun stuff

- An execline quine. This was quinely provided by Joël Riou. The only external command used is `echo`.
- Another quine, provided by Paul Jarc. It is much shorter, but uses the external commands `echo` and `env`. Later, Paul rewrote it using only `echo`, then using only `echo` and the environment.
- Another quine, provided by David Madore. It uses the external command `printf`. It is longer, but quite stylish.

## Related resources

- `execline` is discussed on the skaware mailing-list.