Commit c2a33583 authored by Samarth Joshi's avatar Samarth Joshi

Fixed bug where wc was taken from words instead than lines

parent 038dd69a
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
18 18
4 4
3 3
38 38
\ No newline at end of file
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
15 15
4 4
29 29
38 38
\ No newline at end of file
#!/bin/sh #!/bin/bash
# wc generated_output.txt |awk '{print $2}' # wc generated_output.txt |awk '{print $2}'
mismatch=$(diff generated_output.txt actual_output.txt | grep "c" | wc -l) mismatch=$(diff generated_output.txt actual_output.txt | grep "c" | wc -l)
total=$(wc actual_output.txt |awk '{print $2}') total=$(wc -l < actual_output.txt)
score=$(echo $total-$mismatch | bc) score=$((total-mismatch))
echo "Secured $score marks out of $total" echo "Secured $score marks out of $total"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment