Hey, I was wondering how I could write a bash script which accepts:
Code:
cat <<% | bash ./results06
----------------------------------------------------------
Exam Results 2006
----------------------------------------------------------
________________________________________________________
| |
| The following table consists of exam results from |
| a sample of students who took a course in expressive |
| arts and were assessed via end of term modular exams. |
|________________________________________________________|
| |
----------------------------------------------------------
|STID |Mod 1| Mod 2 | Mod 3 | Mod 4 | Mod 5 | Grade |
----------------------------------------------------------
|801 | 56 | 70 | 80 | 96 | 70 | PASS |
|802 | 41 | 21 | 34 | 16 | 28 | FAIL |
|803 | 59 | 45 | 98 | 43 | 80 | PASS |
|804 | 78 | 99 | 87 | 79 | 90 | PASS |
|805 | 67 | 89 | 76 | 66 | 34 | PASS |
|806 | 34 | 70 | 29 | 14 | 8 | FAIL |
----------------------------------------------------------
In the following sample, the number of students who
passed the course : 4
__________________________________________________________
%
from the standard input, checks the header and footer of the table for validity and only outputs the rows from the table, i.e:
Code:
|801 | 56 | 70 | 80 | 96 | 70 | PASS |
|802 | 41 | 21 | 34 | 16 | 28 | FAIL |
|803 | 59 | 45 | 98 | 43 | 80 | PASS |
|804 | 78 | 99 | 87 | 79 | 90 | PASS |
|805 | 67 | 89 | 76 | 66 | 34 | PASS |
|806 | 34 | 70 | 29 | 14 | 8 | FAIL |
Any help would be appreciated. Thanks!