Please advice I am having problem with the script below. The issue is the red below in the code.
#!/usr/bin/ksh
#Program Name and Directory Name
PROG=`basename $0`
PROG_DIR=`dirname $0`
cd /home/test1 � There are two files in this directory BUILD1.dat and BUILD2.dat with 200 and 6 records respectively.
if [ -f *.dat ] ; then
echo "Input File found...."
inp_file=`ls -1 *.dat`
echo "File Name: " $inp_file
line_cnt=`wc -l $inp_file | cut -c1-8`
echo "The line count is: $line_cnt" � This returns three values 200 and 6 and 206.
diff= `expr 301 - $line_cnt`
echo "The change is: $diff" � This is my issue. I am not getting any values to this....
actual_diff=`expr $line_cnt - 1`
echo "The actual count is: $actual_diff" � This is my issue. I am not getting any values to this....
else
echo "File Not found"
fi