<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="appendpath">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>appendpath</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">nosh</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv><refname>appendpath</refname><refpurpose>add a dir to a path environment variable then chain</refpurpose></refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>appendpath</command>
<arg choice='req'><replaceable>var</replaceable></arg>
<arg choice='req'><replaceable>dir</replaceable></arg>
<arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>Description</title>

<para>
<command>appendpath</command> is a chain-loading utility that appends the value <replaceable>dir</replaceable> to the path environment variable <replaceable>var</replaceable>, and then chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
If the environment variable is set and not empty, it inserts a colon (<code>:</code>) between the old value of <replaceable>var</replaceable> and the appended <replaceable>dir</replaceable>.
</para>

<para>
<replaceable>next-prog</replaceable> may contain its own command line options, which <command>appendpath</command> will ignore.
</para>

</refsection><refsection><title>Author</title>
<para><author><personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname></author></para>
</refsection>

</refentry>
