Hello all Awk's programmer
I have a problem when write this script which to calculate and build the final report for any give grade file. The script takes an option, either -b,-s or a, a grade file name and any other aditional parameters.
The syntax of the script is:
%gradebook -option filename [parameters]
Script functionality:
a) On b option, the script will extract the data from the given
file name and build the grade final report called filename ".report".
If an email address is given, the report will be sent to that email address.
b) On s option, build the report as in b option, then send the result
of the given student ID to her/him, (the email address is extracted from
the report)
c) On a option, build the report as in option b, then send the result to
each student in the file.
the script should validate user input. When a student grade is sent, the script should record a line with the following format on `date ` grades sent to "student email" with "student ID" into a file called gradebook.log
THIS IS MY MAIL SCRIPT
----
#!/bin/csh
#get first parameter as the file name
set filename = $1
#Read each line of the file
nawk '{print "mail" $4
"<<END\n" $0 "\nEND"}"
"$filename"|csh
#search ID (student ID) and sent email
echo search
grep $2 $filename | nawk
'{print "mail" $4 "<<END\n" $0 "\nEND}'|csh
echo done!
--------
ANY "TIPS" WOULD BE APPRECIATE
gatre
I have a problem when write this script which to calculate and build the final report for any give grade file. The script takes an option, either -b,-s or a, a grade file name and any other aditional parameters.
The syntax of the script is:
%gradebook -option filename [parameters]
Script functionality:
a) On b option, the script will extract the data from the given
file name and build the grade final report called filename ".report".
If an email address is given, the report will be sent to that email address.
b) On s option, build the report as in b option, then send the result
of the given student ID to her/him, (the email address is extracted from
the report)
c) On a option, build the report as in option b, then send the result to
each student in the file.
the script should validate user input. When a student grade is sent, the script should record a line with the following format on `date ` grades sent to "student email" with "student ID" into a file called gradebook.log
THIS IS MY MAIL SCRIPT
----
#!/bin/csh
#get first parameter as the file name
set filename = $1
#Read each line of the file
nawk '{print "mail" $4
"<<END\n" $0 "\nEND"}"
"$filename"|csh
#search ID (student ID) and sent email
echo search
grep $2 $filename | nawk
'{print "mail" $4 "<<END\n" $0 "\nEND}'|csh
echo done!
--------
ANY "TIPS" WOULD BE APPRECIATE
gatre