Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
-
The problem statement, all variables and given/known data:
I am trying to complete a script which will allow me to find:
a) reads a value from the keyboard. (ask the user to provide a value)
b) reads each line from the "sercel_output2.3" file in a loop until it finds the value you are looking for
c) counts the occurrences of the value provided
Unitl here I can run the script but I am having trouble with the following two points. I can not use awk
d) fiind the maximum value in the column(there is only one column in the file)
e) calculate the average of the column. ( I only have one point after the decimal) -
Relevant commands, code, scripts, algorithms:
can not use awk
- The attempts at a solution (include all code and scripts):
echo "Please Provide a value"
read x
for value in $( cat sercel_output2.3 )
do
if [ "$x" = "$value" ]
then
echo " value $x found "
else
echo " value $ x not found "
fi
done
grep "$x" sercel_output2.3 | wc -l
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Southern Alberta Institue of Technology Calgary Alberta Canada
Patricia Casto Advanced Linux
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).