Need an extra set of eyes. Can't find function. Can someone help, please. Thanks
echo " Is this the correct list of tapes to eject (y/n)?"
read option
echo $option
case $option in
y|Y) TAPE_ROUTINE;;
n|N) exit
esac
##### Count the number of volumes to eject ########
#### When volume count is 40 go to EJECT_TO SILO ####
TAPE_ROUTINE ()
{
cat $EJECTED_TAPES; echo "ejected these tapes"
TAPE_CT=0
CAP_TOTAL=40
EJECT021=ejectupto40.log
cat /dev/null > $EJECT021
while read volume until EOF
do echo "volume ejected $volume"
TAPE_CT=`expr $TAPE_CT + 1`
echo $TAPE_CT
if [ $TAPE_CT < $CAP_TOTAL ] && [ ! EOF ]
then
cat $volume >> $EJECT021
else
echo "eject $TAPE_CT .. CAP is $CAP_TOTAL first cap"
EJECT\_TO_SILO
fi
done < $EJECTED_TAPES
}
### Eject tapes to Cap with total count is 40 ####
EJECT_TO_SILO ()
{
# /opt/OMIdtelm/bin/eject_vol -t 3600 -c 0,2,1 -l $EJECT021 | tee $EJECT_LOG;
echo "ejected $volume to cap 0 2 1"; sleep 10
mv $EJECT021 ejected_next_group.txt
/dev/null > $EJECT021
$TAPE_CT =0
}
#--------------------------------------
# L O C A L F U N C T I O N S . . .
#--------------------------------------
### Eject tapes to Cap with total count is 40 ####
EJECT_TO_SILO ()
{
# /opt/OMIdtelm/bin/eject_vol -t 3600 -c 0,2,1 -l $EJECT021 | tee $EJECT_LOG;
echo "ejected $volume to cap 0 2 1"; sleep 10
mv $EJECT021 ejected_next_group.txt
/dev/null > $EJECT021
$TAPE_CT =0
}
##### Count the number of volumes to eject ########
#### When volume count is 40 go to EJECT_TO SILO ####
TAPE_ROUTINE ()
{
cat $EJECTED_TAPES; echo "ejected these tapes"
TAPE_CT=0
CAP_TOTAL=40
EJECT021=ejectupto40.log
cat /dev/null > $EJECT021
while read volume until EOF
do echo "volume ejected $volume"
TAPE_CT=`expr $TAPE_CT + 1`
echo $TAPE_CT
if [ $TAPE_CT < $CAP_TOTAL ] && [ ! EOF ]
then
cat $volume >> $EJECT021
else
echo "eject $TAPE_CT .. CAP is $CAP_TOTAL first cap"
EJECT_TO_SILO
fi
done < $EJECTED_TAPES
}
#--------------------------------------
# M A I N . . .
#--------------------------------------
echo " Is this the correct list of tapes to eject (y/n)?"
read option
echo $option
case $option in
y|Y) TAPE_ROUTINE;;
n|N) exit
esac
#--------------------------------------
# L O C A L F U N C T I O N S . . . #--------------------------------------
### Eject tapes to Cap with total count is 40 ####
EJECT_TO_SILO ()
{
# /opt/OMIdtelm/bin/eject_vol -t 3600 -c 0,2,1 -l $EJECT021 | tee $EJECT_LOG;
echo "ejected $volume to cap 0 2 1"; sleep 10
mv $EJECT021 ejected_next_group.txt
/dev/null > $EJECT021
$TAPE_CT =0
}
##### Count the number of volumes to eject ########
#### When volume count is 40 go to EJECT_TO SILO ####
TAPE_ROUTINE ()
{
cat $EJECTED_TAPES; echo "ejected these tapes"
TAPE_CT=0
CAP_TOTAL=40
EJECT021=ejectupto40.log
cat /dev/null > $EJECT021
while read volume until EOF
do
echo "volume ejected $volume"
TAPE_CT=`expr $TAPE_CT + 1`
echo $TAPE_CT
if [ $TAPE_CT != 40 ]
then
$volume | tee $EJECT021
else
echo "eject $TAPE_CT .. CAP is $CAP_TOTAL first cap"
EJECT_TO_SILO
fi
done < $EJECTED_TAPES
}
#--------------------------------------
# M A I N . . . #--------------------------------------
echo " Is this the correct list of tapes to eject (y/n)?"
read option
case $option in
y|Y) TAPE_ROUTINE;;
n|N) exit
#--------------------------------------
# M A I N . . . #--------------------------------------
cat $EJECTED_TAPES
echo "Total Tapes to eject is: "; cat $EJECTED_TAPES | wc -l
echo " Is this the correct list of tapes to eject (y/n)?"
read option
case $option in
y|Y) TAPE_ROUTINE;;
n|N) exit
esac