#!/bin/bashcd ~/simplesim-3.0/benchmarksINSTS=$(grep sim_num_insn ./anagram.txt | awk '{print $2}');IL1_ACCESSES=$(grep il1.accesses ./anagram.txt | awk '{print $2}');IL1_MISSRATE=$(grep il1.miss_rate ./anagram.txt | awk '{print $2}');DL1_ACCESSES=$(grep dl1.accesses ./anagram.txt | awk '{print $2}');DL1_MISSRATE=$(grep dl1.miss_rate ./anagram.txt | awk '{print $2}');IL2_ACCESSES=$(grep il2.accesses ./anagram.txt | awk '{print $2}');IL2_MISSRATE=$(grep il2.miss_rate ./anagram.txt | awk '{print $2}');DL2_ACCESSES=$(grep dl2.accesses ./anagram.txt | awk '{print $2}');DL2_MISSRATE=$(grep dl2.miss_rate ./anagram.txt | awk '{print $2}');IL1_API=`echo scale=4;$DL1_ACCESSES/$INSTS | bc -l`;DL1_API=`echo scale=4;$IL1_ACCESSES/$INSTS | bc -l`;IL2_API=`echo scale=4;$IL2_ACCESSES/$INSTS | bc -l`;DL2_API=`echo scale=4;$DL2_ACCESSES/$INSTS | bc -l`;DL1_P=`echo scale=4;$DL1_MISSRATE*5.0 | bc -l`;IL1_P=`echo scale=4;$IL1_MISSRATE*5.0 | bc -l`;IL2_P=`echo scale=4;$IL2_MISSRATE*40.0 | bc -l`;DL2_P=`echo scale=4;$DL2_MISSRATE*40.0 | bc -l`;DL1_PENALTY=`echo scale=4;$DL1_P*$DL1_API | bc -l`;IL1_PENALTY=`echo scale=4;$IL1_P*$IL1_API | bc -l`;IL2_PENALTY=`echo scale=4;$IL2_P*$IL2_API | bc -l`;DL2_PENALTY=`echo scale=4;$DL2_P*$DL2_API | bc -l`;CPI_a=`echo scale=4;$DL1_PENALTY+$DL2_PENALTY | bc -l`;CPI_b=`echo scale=4;$IL1_PENALTY+1.0 | bc -l`;CPI_c=`echo scale=4;$IL2_PENALTY+$CPI_b | bc -l`;#CPI=`echo scale=4;$UL1_P+1.0+$UL2_P | bc`;CPI=`echo scale=4;$CPI_a+$CPI_c | bc`;echo $CPII am running this script. I checked that the variables assigned from the grep command have been assigned correctly. However, the bash prompt returns(standard_in) 1: syntax error(standard_in) 1: syntax error(standard_in) 1: syntax error(standard_in) 1: syntax error(standard_in) 2: syntax errorI have a hunch that this has something to do with the bc command but I can't figure out what seems to be the problem with it.
BC returns syntax error
grep;echo;bc