While running the script it is failing while searching the pattern if the pattern is found then it is running fine if the pattern is
not found it terminate with error my requirement is if the pattern is not found then it exit successfully.
cat $INTE/CTY_${DATE}_cn_ar.*|cut -c 1-100|grep 'TXT'
if [ $? -eq 0 ]; then
cat $INTE/CTY_${DATE}_cn_ar.*|cut -c 1-100|grep 'TXt' > ${UNI}
else
print "Exit sucessfully"
fi
HI
I have mentioned very small part of our script it is failing while pattern not found
please help me out this issue if any other way we can do ---my requirement is if the pattern not found then it will continue next step
Please give us some help! Which pattern is failing? Are you saying there are no files matching the pattern $INTE/CTY_${DATE}_cn_ar.* ? Or, are you saying that one or more files match that pattern TXT ?
What diagnostic message (if any) is being written when the line of code above fails?
Which version of ksh are you using? (If it is a 1988 version, have you install ksh93 on your system?)