basically when I run my code i get two syntax errors. below:
./Qscript.sh: line 34: unexpected EOF while looking for matching `"'
./Qscript.sh: line 44: syntax error: unexpected end of file
And when I fix those I still get some different errors?
#!/bin/bash
right=0
wrong=0
question=10
i=0
if [ $# -eq 2 ]
then
for((i=0; 1<question;)) {
i=$(expr $i +1)
y=$i
echo "${awk "NR==$y" $1)"
read -p "Enter Answer: " arg1
result=$(awk "NR==$y" $2)
if [ "$arg1" = "$result" ]
then
right=`expr $right + 1`
else
wrong=`expr $wrong + 1`
fi
)
echo "Number_of_correct_answers " $right
echo "Number_of_wrong_answers " $wrong
fi
if [ $# -eq 3 ]
then
for((i=0; i<question;)) {
i=$(expr $i + 1)
y=$i
ans="$(awk "NR==$y" $2)"
resultfile=$(awk "NR==$y" $3)
if [ "$resultfile" = "$ans" ]
then
right=`expr $right + 1`
else
wrong=`expr $wrong + 1`
fi
)
echo $right
fi
forloops lack bothdoanddonetoo.