execline
Software
skarnet.org

# The `export-array` program

`export-array` encodes a set of values into an environment variable, then executes a program.

## Interface

In an execline script:

         export-array [ -d delim ] var { value1 value2 ... } prog...

- `export-array` reads a (possibly empty) block of values, and encodes them into the var environment variable.
- It then execs into prog.

## Options

- `-d` delim : encode the list of values using the first character of delim as a terminator. Only use this when you know the character does not appear in any of the values! By default, no terminator character is specified, and the values are encoded as netstrings.

## Notes

- var must be given without a dollar!
- var must not contain the character `=` .
- A list of values encoded via `export-array VAR { value1 value2 ... }` can be retrieved via `importas -Ssd "" VAR`. Then `${VAR}` will be split into as many words as there are values.
- A list encoded via `export-array -d delim VAR { value1 value2 ... }` can similarly be retrieved via `importas -Ssd delim VAR`.