%$Id: 2batch.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% man commands batch .
% Copyright (C) 2001 Albert Davis
% Author: Albert Davis <aldavis@ieee.org>
%
% This file is part of "Gnucap", the Gnu Circuit Analysis Package
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
% 02110-1301, USA.
%------------------------------------------------------------------------
\section{{\tt <} command}
\index{< command}
\index{batch mode}
\index{files}
\index{disk files}
\index{input redirection}
\index{i-o redirection}
\index{redirection: i-o}
%------------------------------------------------------------------------
\subsection{Syntax}
\begin{verse}
{\tt <} {{\it filename}}\\
{\tt <<} {{\it filename}}
\end{verse}
%------------------------------------------------------------------------
\subsection{Purpose}

Run a simulation in batch mode.  Gets the commands and circuit from a disk
file.  {\tt <<} clears the old circuit, first.
%------------------------------------------------------------------------
\subsection{Comments}

You can invoke the batch mode directly from the command that starts the
program.  The first command line argument is considered to be an argument
for this command.

The file format is almost as you would type it on the keyboard.  Commands
must be prefixed with a dot, and circuit elements can be entered directly,
as if in {\em build} mode.  This is compatible with Spice.  

The {\tt log} command makes a file as you work the program, but the
format is not correct for this command.  To fix it, prefix commands
with a dot, and remove the {\tt build} commands.

Any line that starts with {\tt *} a comment line.

Any line that starts with {\tt .} (dot) is a command.

Any line that starts with a letter is a component to be added or changed.

A {\tt <} command in the file transfers control to a new file.  Files can be
nested.

A bare {\tt <} in the file (or the end of the file) gives it back to the
console.

Unlike SPICE, commands are executed in order.  This can result in some
surprises when using some SPICE files.  SPICE queues up commands, then
executes them in a predetermined order.
%------------------------------------------------------------------------
\subsection{Examples}

\begin{description}

\item[{\tt < thisone.ckt}] Activates batch mode, from the file {\tt
thisone.ckt}, in the current directory.

\item[{\tt < runit.bat}] Use the file {\tt runit.bat}.


From the shell: on start up:

\item[{\tt gnucap afile}] Start up the program.  Start using the file {\tt
afile.ckt} in batch mode, as if you entered {\tt < afile} as the first
command.

\item[{\tt gnucap <afile}] Start up the program.  Start using the file {\tt
afile.ckt} with commands as if you typed them from the keyboard.

\end{description}
%------------------------------------------------------------------------
%------------------------------------------------------------------------
