I have the following script which I am using to add volumes to different files, but I'm not sure how to go about using test with wildcards.
#!/bin/ksh
while read TAPELIST
do
TAPEPREFIX=`echo $TAPELIST |cut -c 1-3`
TAPESERIES=`echo $TAPELIST |cut -c 4-6`
TAPENUM=`echo $TAPELIST |cut -c 1-6`
if [ $TAPEPREFIX = "509" ] && [ $TAPESERIES != "3[0-9][0-9]" ]
then
echo $TAPELIST >> TNTN.$TODAY
else
if [ $TAPEPREFIX = "700" ]
then
echo $TAPELIST >> MTV.$TODAY
else
echo $TAPELIST >> NDHM.$TODAY
fi
fi
done
I would like to make the following line work so that if the value of $TAPESERIES is 3 followed by two more numbers, it will not go to TNTN.$TODAY.
if [ $TAPEPREFIX = "509" ] && [ $TAPESERIES != "3[0-9][0-9]" ]
I tried using "3??" and "3*", but they did not work. Any help would be greatly appreciated.
Thanks,
John
#!/bin/ksh
while read TAPELIST
do
TAPEPREFIX=`echo $TAPELIST |cut -c 1-3`
TAPESERIES=`echo $TAPELIST |cut -c 4-6`
TAPENUM=`echo $TAPELIST |cut -c 1-6`
if [ $TAPEPREFIX = "509" ] && [ $TAPESERIES != "3[0-9][0-9]" ]
then
echo $TAPELIST >> TNTN.$TODAY
else
if [ $TAPEPREFIX = "700" ]
then
echo $TAPELIST >> MTV.$TODAY
else
echo $TAPELIST >> NDHM.$TODAY
fi
fi
done
I would like to make the following line work so that if the value of $TAPESERIES is 3 followed by two more numbers, it will not go to TNTN.$TODAY.
if [ $TAPEPREFIX = "509" ] && [ $TAPESERIES != "3[0-9][0-9]" ]
I tried using "3??" and "3*", but they did not work. Any help would be greatly appreciated.
Thanks,
John