Error occurring in count no .of lines in file and count below line in file

Viewed 24
pioneerId=51882446

singleFileslist="1 2 3 4 5 6 7 8 9 10 11 12"

bundleFileslist="1 2"


dirPath="/home/rev/69.0/RRS0002

for i in $singleFileslist

do singleFile="$dirPath/chflRR.RFC.RRS0002.2208240322893.N$ (pioneerId).${1}.dat"

if [ ! -f "SsingleFile" ]

then

echo "File does not exist $singleFile

exit 1

fi

temp_record_count= 'wc -1 singleFile' trailer_count = 'tail -1 singleFile'

if (temp_record_count != trailer_count)

then

echo "In $singleFile file record count Stemp_record_count is not equal to trailer count Strailer_count" 
exit 1

total_single_record_count =total_record_count + temp_record_count;

done

I got below error


/AutomaticTestRSF.sh[41]: temp_record_count: not found [No such file or directory]

tail: cannot open 'singleFile' for reading: No such file or directory

./AutomaticTestRSF.sh[42]: trailer_count: not found [No such file or directory] ./AutomaticTestRSF.sh[44]: temp_record_count: not found [No such file or directory] ./AutomaticTestRSE.sh[49]: total_single_record_count: not found [No such file or directory] wc: singleFile: No such file or directory

./AutomaticTestRSF.sh[41]: temp_record_count: not found [No such file or directory]

tail: cannot open 'singleFile' for reading: No such file or directory ./AutomaticTestRSF.sh[42]: trailer_count: not found [No such file or directory]

./AutomaticTestRSF.sh[44]: temp_record_count: not found [No such file or directory] ./AutomaticTestRSF.sh[49]: total_single_record_count: not found [No such file
0 Answers
Related