Script Error: 13192.sumr: 0403-016 Cannot find or open the file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script Error: 13192.sumr: 0403-016 Cannot find or open the file.
# 1  
Old 01-21-2008
Script Error: 13192.sumr: 0403-016 Cannot find or open the file.

Hello, i am familiar enough with unix to do some damage but thats about it.

We have a set of RS/6000 43P Model 150's running AIX for our Catia V4 programmers.

back in the 90's a script was written to automate the conversion of files into machine code. that script has started giving us errors. I'm not sure exactly what is causing the problem. the models are available and I chmod'd them to 777 so i know it is not a permissions error.

Any Help is appriciated!

here is the output:

ray-host:/home/ray>ncatscript


WHAT TYPE OF DATA TRANSFER DO YOU WANT TO PREFORM


1) clfile
2) export a model
3) import a model
4) iges
5) list models
6) Catback a model


enter number (1-6)?1


001) /home/brit/models/aerostruct 030) /home/brit/models/rockwell
002) /home/brit/models/alcoa 031) /home/brit/models/rohr
003) /home/brit/models/archive 032) /home/brit/models/saberline
004) /home/brit/models/batch 033) /home/brit/models/shorts
005) /home/brit/models/beech 034) /home/brit/models/temp
006) /home/brit/models/bell 035) /home/brit/models/trainer
007) /home/brit/models/bellhc 036) /home/brit/models/training
008) /home/brit/models/boeing 037) /home/brit/models/tulsa
009) /home/brit/models/boeingtd 038) /home/brit/models/vought
010) /home/brit/models/bombardier 039) /home/bell
011) /home/brit/models/brittain 040) /home/brad
012) /home/brit/models/cessna 041) /home/brian
013) /home/brit/models/dehavilla 042) /home/catadm1
014) /home/brit/models/douglas 043) /home/catadm
015) /home/brit/models/emb 044) /home/catusr
016) /home/brit/models/f16 045) /home/fred
017) /home/brit/models/f22 046) /home/george
018) /home/brit/models/f35 047) /home/greg
019) /home/brit/models/gen-dyn 048) /home/jack
020) /home/brit/models/glfstream 049) /home/kevinw
021) /home/brit/models/hercules 050) /home/kirk
022) /home/brit/models/lear 051) /home/leon
023) /home/brit/models/lockheed 052) /home/mark
024) /home/brit/models/lost+found 053) /home/mike
025) /home/brit/models/misc 054) /home/net
026) /home/brit/models/noarc 055) /home/pat
027) /home/brit/models/northrop 056) /home/ray
028) /home/brit/models/piaggio 057) /home/sam
029) /home/brit/models/ractd 058) /home/zak


Enter number (1-58) to select model directory 6
Do you want to search for a text string? n
001) 141W1162-5 BOEING BBG133
002) 141W1162-6 BOEING BBG155 DOCUMENT ONLY
003) 141W1162-6 BOEING BBG155 01/18/08 RAS
004) 141W1162S03-AD-5 CHORDS - CROWN FRAME, STA 332.5 - 382
005) 141W1162S04--D-6 CHORDS - CROWN FRAME, STA 332.5-382
006) 141W1162S04--D-6 CHORDS - CROWN FRAME, STA 332.5-382COMPARETO-5
007) 146A8921-3
008) 146A8921-3 BOEING POS-1,2,3 BMG116 01/19/2008 RAS
009) 146A8921-3 BOEING POS-1,2,3 BMG116 01/21/2008 RAS
010) 146A8921-3 TEMPLATES BBG154 01/08/2008 RON SEAY
011) 146A8927-8
012) 146A8927-8 BOEING BMG117 01/18/2008 RAS
Enter number 1 thru 12 to select model 12
A file or directory in the path name does not exist.
/u/brit/bin/ncatscript[347]: 13192.sumr: 0403-016 Cannot find or open the file.
ray-host:/home/ray>


And here is the script:
#!/bin/ksh
###############################################################
#
# BRITTAIN MACHINE INCORPORATED
# NOV-04-1992
#
# title: catscript
#
###############################################################
# 3-30-94: Added catdata in IMPORT section.
# 5-06-94: Added search string to model list
# 8-11-94: Moved CED_LOG update to a function
# 7-25-95: Replaced catcfm with ls and list /home/brit/models
# 7-16-96: Added CatBack section.
#12-17-96: Added name selection list for iges name.
# 2-12-97: Added list of Ncset names in selected MODEL
# 2-27-97: Added move input file to /home/brit/CED.
#
# purpose: To aid the input and output of data to the catia system.
#
# method: Arrays are make which contain the directory names of
# the catia models and the model names. The postprocesser names
# are also put into an array. These arrays are used to build
# menus which allow the operator to pick the names to be used
# in the system commands.
# The menus and arrays are used to create parameter files
# which are used with the catutil command to process the
# data to the proper directory.
# files:
# /home/brit/models Catia models
# /home/brit/nctape Tape files
# /junk/post Clfiles to be posted
# /junk Temporary files
###############################################################
integer transtyp=0 i=0 j=0 k=0 nodir=0 idir=0 odir=0 imod=0 ipost=0
integer x=0 y=0 max=0 n=0 flag=0 cnt=0 iset=0
typeset -L30 dir
typeset -L72 modelnm
typeset -Z3 ind
typeset -Z3 ind2
typeset -u ncset str
typeset -L8 nctape
typeset -RZ4 num1
typeset -L3 INS
typeset -L73 char73
typeset -L72 line1
typeset -L72 line2
typeset -R1 last
typeset -L1 char1
uname=$(uname -n)
function affirmative
{
typeset -l reply
while true
do read -r "reply?$1? " || return 1
case $reply in
y|yes) return 0;;
n|no) return 1;;
"") return 0;;
*) print 'Please answer y or n';;
esac
done
}
# Read model directories and user names into dir array
find /home/brit/models -type d -print | sort > $$.name ;
exec 3< "$$.name"
read -u3 line
while read -u3 line
do
nodir=nodir+1
dir[nodir]=$line
done
IFS=
exec 3>&-
lsuser -c -a id ALL | grep -v "#" | sort > $$.name;
exec 3< "$$.name"
while read -u3 line
do
IFS=":"
set $line
if [[ $2 -gt 200 ]]
then
nodir=nodir+1
dir[nodir]="/home/$1"
fi
done
exec 3>&-
rm -f $$.name
function dirlist
{
i=0
((k=nodir/2))
j=$k
clear;
print " "
print " "
until [[ $i -eq $j ]]
do
i=i+1
k=k+1
ind=$i
ind2=$k
print "$ind) ${dir[i]} $ind2) ${dir[k]}"
done
print " "
print " "
print " Enter number (1-$nodir) to select model directory \c"
read ans
}
function modellist
{
IFS=" "
set -- ${dir[idir]}
IFS=
seldir=$1
if affirmative 'Do you want to search for a text string'
then
i=0
while [[ $i -eq 0 ]]
do
print "Enter the text string to search for"
read str
ls -A $seldir | tr '\261' ' ' | tr '\264' '/' | grep $str > $$.mod;
line=$(ls -s $$.mod)
IFS=" "
set -- $line
IFS=
if [[ $1 -eq 0 ]]
then
print "No models found"
print " "
else
i=1
fi
done
else
ls -A $seldir | tr '\261' ' ' | tr '\264' '/' > $$.mod;
fi
i=0
j=0
# clear;
printpage
}
function printpage
{
exec 3< "$$.mod"
IFS=
while read -u3 line
do
if [[ ${#line} = 0 ]]
then
continue
fi
i=i+1
j=j+1
ind=$j
line=${line%".model"}
mod[j]=$line
print "$ind) ${mod[j]}"
if [[ $i -eq 23 ]]
then
i=1
print "Press ENTER to continue \c"
IFS=
read str
if [[ ${#str} = 0 ]]
then
print ${dir[idir]}
continue
else
break
fi
fi
done
exec 3>&-
rm -f $$.mod;
}
function CEDLOG
{
cus=${dir[idir]##/home/brit/models/}
tmp="nothing"
case $cus in
temp*) tmp="ask" ;;
noarc*) tmp="ask" ;;
archive*) tmp="ask" ;;
brittain*) tmp="ask" ;;
training*) tmp="ask" ;;
esac
if [[ $tmp = "ask" ]]
then
print "Enter the Customer Name"
read cus
fi
line=$(grep "^CED" /home/brit/data/CED_LOG| tail -1)
num1=$line
i=$num1
((i=i+1))
num1=$i
mv /junk/$CEDfile /home/brit/CED/CED$num1 ;
print /junk/$CEDfile /home/brit/CED/CED$num1
print "DISK CED$num1 $(date +"%b %d %Y")" >> \
/home/brit/index/CEDarchive
exec 4> $$.CED
print -u4 "CED$num1"
print -u4 "dr:$(date +%m-%d-%y)"
print -u4 "dt:$datatype"
print ""
print "1. 9 track tape"
print "2. 1/4 inch tape"
print "3. 8mm tape"
print "4. 3 and 1/2 floppy disk"
print "5. 5 and 1/4 floppy disk"
print "6. compact laser disk"
print "7. modem"
print ""
print "Enter number 1 - 7"
read line
case $line in
1) mt="9t" ;;
2) mt="tc" ;;
3) mt="8mm" ;;
4) mt="3f" ;;
5) mt="5f" ;;
6) mt="cd" ;;
7) mt="mo" ;;
"") break ;;
*) break ;;
esac
print -u4 "mt:$mt"
print -u4 "cus:$cus"
if [[ $mt != "mo" ]]
then
print "Enter the customers tape number"
read line
if [[ -n $line ]] then
print -u4 "ctn:$line"
fi
else
print -u4 "ctn:$CEDfile"
fi
print -u4 "cl:/home/brit/CED"
if [[ $transtyp -eq 3 ]]
then
exec 3< /junk/catimp.out
while read -u3 line
do
IFS=" "
set -- $line
if [[ $2 = "MODEL" && $3 = "NAME" ]]
then
read -u3 line
IFS=
tmp="bfn:${line#I }"
line=${tmp%% I}
while [[ -z ${line%%* } ]]
do
tmp=${line% }
line=$tmp
done
print -u4 $line
fi
done
exec 3>&-
fi
if [[ $transtyp -eq 7 ]]
then
exec 3< /junk/catdata.out
while read -u3 line
do
IFS=" "
set -- $line
if [[ $2 = "MODEL" ]]
then
while [[ ! -z $line ]]
do
read -u3 line
echo $line > /tmp/testline
temp=$(cat /tmp/testline | cut -c 3-72)
line=${temp%% COPIED}
print -u4 $line
done
fi
done
exec 3>&-
fi
if [[ $transtyp -eq 4 ]]
then
print -u4 "bfn:$modelnm"
fi
print -u4 "end:"
exec 4>&-
cat $$.CED >> /home/brit/data/CED_LOG ;
cat $$.CED ;
print "Label the tape CED$num1"
}
###############################################################
# MAIN PROGRAM
###############################################################
cd /junk;
clear;
while [[ $transtyp -lt 1 || $transtyp -gt 6 ]]
do
print " "
print " "
print " WHAT TYPE OF DATA TRANSFER DO YOU WANT TO PREFORM"
print " "
print " "
print " 1) clfile"
print " 2) export a model "
print " 3) import a model"
print " 4) iges"
print " 5) list models"
print " 6) Catback a model"
print " "
print " "
print " enter number (1-6)?\c"
read transtyp
if [[ $transtyp -lt 1 || $transtyp -gt 6 ]]
then
print " number must be from 1 to 6 "
fi
done
###############################################################
# CLFILE
###############################################################
if [[ $transtyp -eq 1 ]]
then
dirlist
idir=$ans
modellist
print "Enter number 1 thru $j to select model \c"
read ans
imod=$ans
modelnm=${mod[imod]%".model"}
print "*REA ${dir[idir]}" >$$.out
print "*MOD $modelnm" >> $$.out
print "*RUN" >> $$.out
catutil -l catsumr -x $$.out -o $$.sumr > $$.err 2> /dev/null ;
rm -f $$.out
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
rm -f $$.err
exit 1
fi
exec 3< $$.sumr
IFS=
while read -u3 line
do
line=${line%I}
x=0
while [[ ${#line} -ne $x ]]
do
x=${#line}
line=${line%" "}
done
if [[ $flag -eq 1 && ${#line} -eq 3 ]]
then
break
fi
if [[ $line = " I NUMERICAL CONTROL : TOOL" ]]
then
flag=1
continue
fi
if [[ $flag -eq 1 ]]
then
cnt=cnt+1
ncset[cnt]=${line#" I - "}
fi
done
x=0
i=0
clear;
while [[ $x -lt $cnt ]]
do
i=i+1
x=x+1
ind=$x
print "$ind) ${ncset[x]}"
if [[ $i -eq 23 ]]
then
i=1
print "Press ENTER to continue \c"
IFS=
read str
if [[ ${#str} = 0 ]]
then
continue
else
break
fi
fi
done
print " Enter number 1 thru $ind to select ncset \c"
read ans
iset=$ans
nctape=${ncset[iset]}
IFS=-
set -- ${ncset[iset]}
IFS=
if [[ $# -eq 2 ]]
then
nctape=$1$2
fi
ls /home/brit/gpost/*.dat|cut -d/ -f5|cut -d. -f1 > $$.mod;
exec 3< "$$.mod"
i=0
j=0
clear;
while read -u3 line
do
if [[ ${#line} = 0 ]]
then
continue
fi
i=i+1
ind=$i
post[i]=$line
print "$ind) ${post[i]}"
done
exec 3>&-
print " "
print " Enter number (1-$i) to select post processor \c"
read ipost
postprt="N"
if affirmative 'Do you want a print out of the nctape files '
then
postprt="Y"
fi
IFS=""
exec 3> "$$.out"
print -u3 "*REA ${dir[idir]}"
print -u3 "*MOD ${modelnm}"
print -u3 "*NCS ${ncset[iset]}"
print -u3 "*WRI $BRITCL"
print -u3 "*MEM $nctape"
print -u3 "*REP Y"
print -u3 "*CIR 2"
print -u3 "*PPR 2"
print -u3 "*RAP"
print -u3 "*CUT OFF"
print -u3 "*MAC"
print -u3 "*APT 2"
print -u3 "*RUN"
exec 3>&-
print "Creating apt source file in $BRITCL"
catutil -l catnc -x $$.out 2> $$.err ;
rm -f $$.out $$.mod;
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
IFS=" "
set -- $nctape
IFS=
mv $BRITCL/$1".aptsource" $BRITCL/${ncset[iset]} ;
#
chmod 777 /junk/catnc.out
# Removed 4/26/97 for 4.1.5 AIX upgrade
# chmod 666 $BRITCL/${ncset[iset]} 2> /dev/null ;
asc ${ncset[iset]};
INS=${ncset[iset]}
print " "
if [[ $postprt = "Y" ]]
then
if [[ $INS = "INS" ]]
then
insp_list ${ncset[iset]} ;
prt -z /junk/nctape/${ncset[iset]}.cmm ;
else
post ${ncset[iset]} ${post[ipost]};
fi
else
if [[ $INS = "INS" ]]
then
insp_list ${ncset[iset]} ;
else
post -n ${ncset[iset]} ${post[ipost]};
fi
fi
fi
###############################################################
# EXPORT A MODEL
###############################################################
if [[ $transtyp -eq 2 ]]
then
dirlist
idir=$ans
modellist
print "Select numbers such as : 5-8,12-14,20 \c"
read list
max=j
if [[ ${#list} = 0 ]]
then
print "No selection can not continue"
exit 1
fi
((y=1))
IFS=,
set -- $list
tmp[0]=$#
if [[ $1 -eq 0 ]]
then
continue
fi
while [[ $# -gt 0 ]]
do
tmp[y]=$1
shift
((y=y+1))
done
((y=1))
((i=0))
rm -f $$.list ;
while [[ $y -le ${tmp[0]} ]]
do
IFS=-
set -- ${tmp[y]}
((i=i+1))
x=$1
if [[ $x -gt $max ]]
then
print "You entered a number greater than the list"
exit 1
fi
print "$x" >> $$.list
while [[ $x -lt $2 ]]
do
((i=i+1))
((x=x+1))
if [[ $x -gt $max ]]
then
print "You entered a number greater than the list"
break
fi
print "$x" >> $$.list
done
((y=y+1))
done
sort $$.list | uniq > $$.sort ;
clear;
print " "
print " "
print " Enter the filename of the EXPORT file "
read ans
CATIN="/junk/$ans"
export CATIN
print " Do you want to run CATAIX on this file"
if affirmative
then
type=64
fi
print "Running catexp"
exec 3> "$$.out"
print -u3 "*REA ${dir[idir]} MODEL"
print -u3 "*WRI $CATIN STORAGE_DEVICE"
print -u3 "*DRP Y"
exec 4< "$$.sort"
read -u4 n
i=$(tail -1 $$.sort)
while [[ $n -le $i ]]
do
if [[ $n -eq 0 ]]
then
break
fi
modelnm=${mod[n]%".model"}
print -u3 "*MOD $modelnm"
read -u4 n
done
exec 4>&-
print -u3 "*EXP"
exec 3>&-
catutil -l catexp -x $$.out 2> $$.err ;
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
rm -f $$.out $$.list $$.sort $$.err;
if [[ $type -eq 64 ]]
then
print "Running cataix"
CATOUT="$CATIN.ebcdic"
export CATIN CATOUT
exec 3> "$$.out"
print -u3 "*REA $CATIN STORAGE_DEVICE"
print -u3 "*WRI $CATOUT STORAGE_DEVICE"
print -u3 "*EBCDIC"
print -u3 "*RUN"
exec 3>&-
catutil -l cataix -x $$.out;
print "Your file name is /junk/$CATOUT"
rm -f $$.out;
fi
fi
###############################################################
# IMPORT A MODEL
###############################################################
if [[ $transtyp -eq 3 ]]
then
clear;
# rm -f /home/catadm/site/dummy.corr_tables ;
# if [[ $? != 0 ]]
# then
# print " "
# print " "
# print " Did not have permission to remove dummy file"
# print " "
# print " Enter the command rmdummy & rerun catscript"
# exit 1
# fi
print " "
print " "
print " Enter the filename of the IMPORT file "
read ans
CEDfile=$ans
CATIN="/junk/$ans"
dirlist
idir=$ans
if [[ ${#ans} = 0 ]]
then
idir=1
dir[idir]="/home/brit/models/temp"
fi
line=$(od -x $CATIN | head -1)
IFS=" "
set -- $line
catia=$2$3$4
if [[ $catia = 4bc3c1e3c9c1 ]]
then
type=$(exportype $CATIN)
print $type
if [[ type -eq 64 ]]
then
print "Running cataix"
CATOUT="$CATIN.aix"
export CATIN CATOUT
exec 3> "$$.out"
print -u3 "*REA $CATIN STORAGE_DEVICE"
print -u3 "*WRI $CATOUT STORAGE_DEVICE"
print -u3 "*ASCII"
print -u3 "*RUN"
exec 3>&-
catutil -l cataix -x $$.out 2> $$.err ;
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
rm -f $$.out;
CATIN=$CATOUT
fi
export CATIN
print "Running catimp"
exec 3> "$$.out"
print -u3 "*REA $CATIN STORAGE_DEVICE"
print -u3 "*WRI ${dir[idir]} MODEL"
print -u3 "*DRP Y"
print -u3 "*REP Y"
print -u3 "*FOR Y"
print -u3 "*NOCATT Y"
print -u3 "*NOCMAT Y"
print -u3 "*NOCPAT Y"
print -u3 "*NOCANN Y"
print -u3 "*CORFIC dummy"
print -u3 "*CORPRJ dummy"
print -u3 "*ALL"
print -u3 "*IMP"
exec 3>&-
catutil -l catimp -x $$.out 2> $$.err ;
rm -f /junk/dummy*
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
if affirmative 'Do you want to update the CED LOG'
then
datatype="Catia Export"
CEDLOG
fi
else
export CATIN
print "Running catdata"
exec 3> "$$.out"
print -u3 "*REA $CATIN STORAGE_DEVICE"
print -u3 "*WRI ${dir[idir]} MODEL"
print -u3 "*REP Y"
print -u3 "*COP ALL"
exec 3>&-
catutil -l catdata -x $$.out 2> $$.err ;
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
if affirmative 'Do you want to update the CED LOG'
then
datatype="Catia Catdata"
transtyp=7
CEDLOG
fi
# rm -f $$.out $$.tmp /home/catadm/site/dummy?.corr_tables ;
fi
fi
###############################################################
# IGES
###############################################################
if [[ $transtyp -eq 4 ]]
then
export IGES_TEMP=/junk
clear;
print " "
print " "
print " 1) catia model to iges file"
print " 2) iges file to catia model"
print " "
print " "
read iges
dirlist
idir=$ans
if [[ ${#ans} = 0 ]]
then
idir=1
dir[idir]="/home/brit/models/temp"
fi
if [[ $iges -eq 1 ]]
then
modellist
print "Enter number 1 thru $j to select model \c"
read ans
imod=$ans
print "Enter the filename minus the required .iges"
read file
exec 3> "$$.out"
modelnm=${mod[imod]%".model"}
print -u3 "*REA ${dir[idir]} MODEL"
print -u3 "*MOD $modelnm"
print -u3 "*IIFFILE $file.iif"
print -u3 "*DBGFILE /dev/null"
print -u3 "*MLV WARN"
print -u3 "*RUN"
exec 3>&-
print "Creating the iif file"
catutil -l catige -x $$.out ;
rm -f $$.out;
cdir=$PWD
cd /usr/lpp/iges/prog;
print "Creating the iges file"
igesp -c $cdir/$file;
else
ls -A *.iges > $$.mod 2> /dev/null ;
i=0
j=0
printpage
if [[ j -gt 0 ]]
then
print "Enter number 1 thru $j to select model \c"
read ans
imod=$ans
file=${mod[imod]%".iges"}
else
print "Enter the filename of the IGES file"
read file
if [[ -s $file ]]
then
mv $file $file.iges
else
print "File $file does not exist"
exit
fi
fi
CEDfile=$file.iges
head -20 "$file.iges" > $$.name ;
exec 3< "$$.name"
IFS=
while read -u3 line
do
char73=$line
last=$char73
if [[ $last = "G" ]]
then
line1=$line
read -u3 line2
line=$line1$line2
INS=$line
last=$INS
IFS="$last"
set -- $line
IFS=
# CATIA will convert the " " and "/" characters for you.
S1=$3
char1=$S1
while [[ $char1 = [0-9] ]]
do
S1=${S1#$char1}
char1=$S1
done
S1=${S1#$char1}
S2=$4
char1=$S2
while [[ $char1 = [0-9] ]]
do
S2=${S2#$char1}
char1=$S2
done
S2=${S2#$char1}
S3=$5
char1=$S3
while [[ $char1 = [0-9] ]]
do
S3=${S3#$char1}
char1=$S3
done
S3=${S3#$char1}
break
fi
done
print
print "0= Enter your own name"
print
print "1= $S1"
print "2= $S2"
print "3= $S3"
print
print "Enter number 0 thru 3"
read ans
if [[ $ans < 0 || $ans > 3 ]]
then
print "You entered the wrong value for MODEL name selection"
exit
fi
if [[ $ans = 0 ]]
then
print "Enter the MODEL name for this file"
read modelnm
fi
if [[ $ans = 1 ]]
then
modelnm=$S1
fi
if [[ $ans = 2 ]]
then
modelnm=$S2
fi
if [[ $ans = 3 ]]
then
modelnm=$S3
fi
print $modelnm
exec 3>&-
exec 3> "$$.out"
print -u3 "*IIFFILE $file.iif"
print -u3 "*WRI ${dir[idir]}"
print -u3 "*REP y"
print -u3 "*MOD $modelnm"
print -u3 "*DBGFILE /dev/null"
print -u3 "*LINDEX 6000"
print -u3 "*LDATA 30000"
print -u3 "*RUN"
exec 3>&-
cdir=$PWD
cd /usr/lpp/iges/prog;
print "Creating the iif file"
igesp -i $cdir/$file;
print "Creating the catia model"
cd $cdir
catutil -l igecat -x $$.out 2> $$.err ;
tail -23 igecat.out
if affirmative 'Do you want to update the CED LOG'
then
datatype="IGES"
CEDLOG
fi
rm -f $$.out $$.name;
fi
ls -l $cdir/$file*;
fi
rm -f $$* ;
###############################################################
# LIST MODELS
###############################################################
if [[ $transtyp -eq 5 ]]
then
clear;
print " "
print " "
print " 1) List ALL directories"
print " 2) List Selected directory"
print " "
print " "
read mlist
if [[ $mlist -eq 1 ]]
then
if affirmative 'Do you want to search for a text string'
then
print "Enter the text string to search for"
read searchstr
fi
x=1
i=0
j=0
clear;
while [[ x -lt nodir ]]
do
x=x+1
idir=$x
IFS=" "
set -- ${dir[idir]}
IFS=
if [[ ${#searchstr} = 0 ]]
then
ls -A $1 | tr '\261' ' ' | tr '\264' '/' > $$.name;
else
ls -A $1 | tr '\261' ' ' | tr '\264' '/' | grep $searchstr > $$.name;
fi
grep ".model" $$.name > $$.mod
print ${dir[idir]}
printpage
i=i+1
if [[ $i -eq 23 ]]
then
i=1
print "Press ENTER to continue \c"
IFS=
read str
if [[ ${#str} = 0 ]]
then
print ${dir[idir]}
continue
else
exit
fi
fi
done
else
dirlist
idir=$ans
modellist
fi
exit
fi
###############################################################
# CATBACK A MODEL
###############################################################
if [[ $transtyp -eq 6 ]]
then
dirlist
idir=$ans
modellist
print "Select numbers such as : 5-8,12-14,20 \c"
read list
max=j
if [[ ${#list} = 0 ]]
then
print "No selection can not continue"
exit 1
fi
((y=1))
IFS=,
set -- $list
tmp[0]=$#
if [[ $1 -eq 0 ]]
then
continue
fi
while [[ $# -gt 0 ]]
do
tmp[y]=$1
shift
((y=y+1))
done
((y=1))
((i=0))
rm -f $$.list ;
while [[ $y -le ${tmp[0]} ]]
do
IFS=-
set -- ${tmp[y]}
((i=i+1))
x=$1
if [[ $x -gt $max ]]
then
print "You entered a number greater than the list"
exit 1
fi
print "$x" >> $$.list
while [[ $x -lt $2 ]]
do
((i=i+1))
((x=x+1))
if [[ $x -gt $max ]]
then
print "You entered a number greater than the list"
break
fi
print "$x" >> $$.list
done
((y=y+1))
done
sort $$.list | uniq > $$.sort ;
clear;
print " "
print " "
print "Running catback"
exec 3> "$$.out"
print -u3 "*REA ${dir[idir]} MODEL"
exec 4< "$$.sort"
read -u4 n
i=$(tail -1 $$.sort)
while [[ $n -le $i ]]
do
if [[ $n -eq 0 ]]
then
break
fi
modelnm=${mod[n]%".model"}
print -u3 "*MOD $modelnm"
read -u4 n
done
exec 4>&-
print -u3 "*ACTION"
print -u3 "*WRI /home/brit/models/temp MODEL"
print -u3 "*RENAME 67 V414"
print -u3 "*VERSION 3"
print -u3 "*RELEASE 2"
print -u3 "*MR 5"
print -u3 "*FORMAT LONG"
print -u3 "*RUN"
exec 3>&-
catutil -l catback -x $$.out 2> $$.err ;
line=$(grep "FAILED" $$.err)
if [[ ${#line} != 0 ]]
then
cat $$.err
exit 1
fi
# rm -f $$.out $$.list $$.sort $$.err;
fi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find Error: rpmdb open failed on list of servers

Hello all, I have a task to patch red hat servers and some servers have a corrupted rpm database and return the error: Error: rpmdb open failed I know how to fix this when it occurs. What I'm hoping to do is scan a list of servers by IP and report back which server have this error. ... (6 Replies)
Discussion started by: greavette
6 Replies

2. UNIX for Beginners Questions & Answers

0403-016 Cannot find or open the file in If Statement

Hi, I am comparing the number of records in the .bad record from sql loader, if it is higher than the number passed in as an argument, the program should exit. However, I constantly receive the error " 0403-016 Cannot find or open the file." on the line with the if statement "elif ;". The code... (3 Replies)
Discussion started by: MIA651
3 Replies

3. AIX

Error while script execution - 0403-029 there is not enough memory available now

Hi, I am executing a shell script on AIX box where I need to list all the files in the file system and then do some other tasks with them. I am able to do this successfully on HP-UX and Linux boxes but I get the following error after 10-15 seconds when I try to execute the script on an AIX box. ... (6 Replies)
Discussion started by: Adyan Faruqi
6 Replies

4. UNIX for Dummies Questions & Answers

Find error in the shell script file

echo "******Select Option:******" echo "1 - script1" echo "2 - script2" echo "3 - script3 " read option echo "You have selected" $option"." if then /scratch/username/script1.sh elif then /scratch/username/script2.sh elif then /scratch/username/script3.sh else echo "Please try again... (12 Replies)
Discussion started by: Dish
12 Replies

5. AIX

backup script failed with error '0403-005 Cannot create the specified file'

In AIX 5.1, a daily run script that backing up oracle data failed yesterday with following errors: The Tivoli backup of DBPROD failed. What could be the issue, OS, backup or Oracle? (3 Replies)
Discussion started by: jalite19
3 Replies

6. SCO

Error: msgcnt 1 vxfs: mesg 016: vx_ilisterr - / file system error reading

Hello... i got an error in my SCO OpenServer 6. the error is: msgcnt 1 vxfs: mesg 016: vx_ilisterr - / file system error reading inode 373 Can anyone help me? (1 Reply)
Discussion started by: AndryMB
1 Replies

7. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

8. Shell Programming and Scripting

Problem with shell script - Error: 0403-057

Hi, I am new to shell scripts may be the error is very very small and i am unable to catch hold of it, any suggestion would be appreciated....error is at the bottom: +210 # get file type +211 filetype=`tail -1 "$inputdir"/"$i"|cut -d"|" -f2` +212 # +213 # get the record count as specified... (4 Replies)
Discussion started by: ravi0435
4 Replies

9. Solaris

Error Message: find: cannot open /: Stale NFS file handle

I am using the "find" command below and it respond with the error message " find: cannot open /: Stale NFS file handle" what does it mean? what can I do about it? Need advice, thanks. below are the command that I enter, the respond and the error message: root@ScripServer:/# find / -name... (1 Reply)
Discussion started by: ezsurf
1 Replies

10. Shell Programming and Scripting

getting error 0403-016 Cannot find or open the file while reading a long line

Hi, I have an requirement of reading a long line of 7000 chars and cutting it iam doing this : while read -r x do echo $x ......... done < `cat filename` when iam doing this it is giving me "0403-016 Cannot find or open the file." Can anyone let how this can be done. (2 Replies)
Discussion started by: karthee
2 Replies
Login or Register to Ask a Question