Programming in M4sh

M4sh is aiming at producing portable Bourne shell scripts. For the time being, it is not mature enough to be widely used.

M4sh provides portable alternatives for some common shell constructs that unfortunately are not portable in practice.

function>AS_DIRNAME/function> (pathname) Return the directory portion of pathname, using the algorithm required by posix. the section called “Limitations of Usual Tools”, for more details about what this returns and why it is more portable than the dirname command.

function>AS_MKDIR_P/function> (filename) Make the directory filename, including intervening directories as necessary. This is equivalent to mkdir -p filename, except that it is portable to older versions of mkdir that lack support for the -p option.