bind

bind

part of shnell – a source to source compiler enhancement tool

© Jens Gustedt, 2018

Directive to bind variables to values

This directive expects arguments in the form

NAME0=VALUE0 [TOK0_0 ...] NAME1=VALUE1 [TOK1_0 ...] ...

(without special characters) and replaces all occurrences of ${NAME0} (with the dollar and the braces) in the submitted text by VALUE0 TOK0_0 ... etc. So all tokens that do not contain an = sign are collected into a list of value tokens for NAME0 etc. A token on the line that contains a = starts the list for the next meta-variable NAME1 etc.

All occurences of #${NAME0} (with the hash, the dollar and the braces) are replaced by "VALUE0 TOK0_0 ...", that is the value put inside a C string.

Coding and configuration

The following code is needed to enable the sh-module framework.

SRC="$_" . "${0%%/${0##*/}}/import.sh"

Imports

The following sh-modules are imported:

Details

See also:

do

env

foreach

let