Re: Ontape and Shell Script
Posted in 1997
Con Woodall <cwoodall@vth4.vth.colostate.edu> schrieb im Beitrag
<5fk575$b0d@cssun.mathcs.emory.edu>...
> On Tue, 4 Mar 1997, Terron Wright wrote:
>
> > I am trying to run in a shell script and I wondering if there is a way
> > to make ontape skip the mount tape message. I was wondering if I could
> > be pipe ontape to a return command. Could someone shed a little light
on
> > this subject if this is possible, please.
> >
> Terron,
> We run a shell that does this by using an input file that has a couple of
> new-line entries. We call it archive.input.
>
> The shell, run_arc.sh, contains the lines below looks. It runs a level
zero
> without requiring a tape mount prompt.
>
> run_arc.sh
>
> ontape -s -L 0 < /inf_dir/bin/archive.input \\
> >> /inf_dir/error/archive.out 2>> /object/error/archive.out
Con (and Terron),You can improve your shell script using the so called here-document, for
example:
ontape -s -L 0 <<END >>archive.out 2>>archive.out
END
All lines between "<<END" and the line starting with "END" are used as
stdin of ontape. In our example there is only one NL, that's it.
So you can save the 2nd file (archive.input).