Hi Nathan - I see where you are confused now. The good news is we can clear up that confusion pretty quickly. The bad news is that (looking at a comment in your script) you need to do the tape change commands from inside your script as well - later though.
First of all:
The heart of your script is the mksysb command.
The command you use is a perfectly valid one, but let's have a look at it in more detail:
mksysb -i /dev/rfd0 > TapeMsg 2>&1 &
This runs the mksysb command, in the background, and pipes its standard output and standard error to a file calles TapeMsg.
But mksysb's standard input is *not* being redirected, and this is what you need to do.
The ordinary way of redirecting input would work like this:
mksysb -i /dev/rfd0 > TapeMsg 2>&1 <keysfile &
This will make mksysb run as before, but look in the file keysfile whenever it needs a response rather than look at the keyboard. The keystrokes in the file keysfile will sit there until they are asked for by mksysb.
All very well - but now the bad news. This isn't what you want to do.
From looing at your script you need to:
Watch for the tape change condition, change the tape, let mksysb carry on.
For this you will need to something like expect or Perl - do you have either of those packages available?
Alternatively - your tape changer. Can you get it to react to and end-of-tape condition by automatically changing the tape? Mike
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.