www.delorie.com/gnu/docs/octave/kpathsea_56.html   search  
Buy GNU books!

Kpathsea: A library for path searching

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.4 Brace expansion

`x{a:b}y' expands to `xay:xby'. For example:


expands to `foo/1/baz:foo/2/baz'. `:' is the path separator on the current system; e.g., on a DOS system, it's `;'.

Braces can be nested; for example, `x{A:B{1:2}}y' expands to `xAy:xB1y:xB2y'.

Multiple non-nested braces are expanded from right to left; for example, `x{A:B}{1:2}y' expands to `x{A:B}1y:x{A:B}2y', which expands to `xA1y:xB1y:xA2y:xB2:y'.

This feature can be used to implement multiple TeX hierarchies, by assigning a brace list to $TEXMF, as mentioned in `texmf.in'.

In old versions of the library you had to use a comma. While this usage is deprecated, it is still supported for backwards compatibility with old configurations. The last example could have been written `x{A,B}{1,2}y'.

Brace expansion is implemented in the source file `kpathsea/expand.c'. It is a modification of the Bash sources, and is thus covered by the GNU General Public License, rather than the Library General Public License that covers the rest of Kpathsea.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003