Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS699OutLab2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Roshan Rabinarayan
CS699OutLab2
Commits
c2a33583
Commit
c2a33583
authored
Aug 28, 2020
by
Samarth Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug where wc was taken from words instead than lines
parent
038dd69a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
q4/actual_output.txt
q4/actual_output.txt
+1
-1
q4/generated_output.txt
q4/generated_output.txt
+1
-1
q4/q4.sh
q4/q4.sh
+8
-8
No files found.
q4/actual_output.txt
View file @
c2a33583
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
18
18
4
4
3
3
38
38
\ No newline at end of file
q4/generated_output.txt
View file @
c2a33583
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
15
15
4
4
29
29
38
38
\ No newline at end of file
q4/q4.sh
View file @
c2a33583
#!/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
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment