2.7.2 Variables accessors

Preprocessor Macro: mbfl_namevar (NAME)

The argument NAME must be the name of a proxy variable. Uses of this macro expand into:

mbfl_a_variable_NAME

Given the name of a proxy variable: expand into the name of the name variable.

Preprocessor Macro: mbfl_datavar (NAME)

The argument NAME must be the name of a proxy variable. Uses of this macro expand into:

$mbfl_a_variable_NAME

Given the name of a proxy variable: expand into code that, executed at run–time, returns the name of the data variable.

This macro is often used, we may find useful a shortcut like:

m4_define([[[_]]],[[[mbfl_datavar([[[$1]]])]]])

with which we write code like:

mbfl_declare_varref(RV)

mbfl_file_extension_var _(RV) /path/to/file.ext
"$RV"  ⇒ ext

We must be careful if the source code contains the standalone underscore character.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.