<?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="line-banner">

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

<refnamediv><refname>line-banner</refname><refpurpose>chain-load utility for printing 1-line banners</refpurpose></refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>line-banner</command>
<arg choice='opt'>--NVT</arg>
<arg choice='req'><replaceable>banner</replaceable></arg>
<arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>Description</title>

<para>
<command>line-banner</command> is a chain-loading utility that prints the 1-line banner <replaceable>banner</replaceable> (followed by a newline) to its standard output, and then chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
</para>

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

<para>
<command>line-banner</command> makes no alteration to process state.
</para>

<para>
If the <arg choice='plain'>--NVT</arg> command-line option is used, the newline follows the Network Virtual Terminal convention of carriage return plus a linefeed.
Normally, it follows the Unix convention of just a linefeed.
</para>

</refsection><refsection><title>EXAMPLE</title>

<para>
The following <citerefentry><refentrytitle>nosh</refentrytitle><manvolnum>1</manvolnum></citerefentry> script wraps the <citerefentry><refentrytitle>ftpd</refentrytitle><manvolnum>1</manvolnum></citerefentry> server from the publicfile package, which requires that the initial 220 response be written before the d&#xe6;mon is invoked.
</para>

<informalexample><programlisting>#!/bin/nosh
fdmove -c 2 1
envuidgid publicfile
softlimit -o 20 -d 50000
tcp-socket-listen -b 2 0 80
tcp-socket-accept -v -c 2 -x cdb.tcp -l 0 --no-delay
line-banner --NVT "220 Features: a p ."
sh -c 'exec ftpd ~publicfile/public'
</programlisting></informalexample>

<para>
This is the <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry> equivalent:
</para>

<informalexample><programlisting>#!/bin/sh -e
exec 2&lt;>&amp;1 \
envuidgid publicfile \
softlimit -o 20 -d 50000 \
tcp-socket-listen -b 2 0 80 \
tcp-socket-accept -v -c 2 -x cdb.tcp -l 0 --no-delay \
line-banner --NVT '220 Features: a p .' \
ftpd ~publicfile/public</programlisting></informalexample>

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

</refentry>
