Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Really you're not asking about vi at all, you're asking how to sort a list and get the highest and lowest values. sort, head and tail are commands that you'll want to use.
The script must warn if a student is missing a mark or if the mark is unreadable (e.g. a letter instead of a number) from a list of student names and grades.
Instead of creating lots of threads for what appears to be the same problem, you should really just have one thread in which you describe what you're trying to do in full, where you're stuck, etc.
The file contains student names and grades in the following format:
#Name Marks
Joe Munson 92
Bob Smith 45
Jill Taylor 85
Jane Hathaway 65
Elliot Parsons 72
Mike Jackson 0
The script must be able to handle files of varying number of lines
The script must warn if a student is missing a mark or if the mark is unreadable (e.g. a letter instead of a number).
The script will calculate the class average, the highest mark and the lowest mark.
The output display shold look like this:
The name of the file is: studentmarks.txt
The class average is: 59.8%
The highest mark is: 92 (Joe Munson)
The lowest mark is : 0 (Mike Jackson)
Quote:
Originally Posted by Nylex
Instead of creating lots of threads for what appears to be the same problem, you should really just have one thread in which you describe what you're trying to do in full, where you're stuck, etc.
The script must warn if a student is missing a mark or if the mark is unreadable (e.g. a letter instead of a number) from a list of student names and grades.
Also this seems like a line straight out of an assignment. Help with homework isn't allowed, so if you want to evade that rule be creative about what you ask and how you ask for it.
Quote:
Originally Posted by BBFeltham
The script must
BTW, asking for help with something implies phrasing it like a question. Now try to ask for stuff in your own words.
And like Nylex already asked you: please post whatever script or pseudo script you have and we'll help you correct and add things.
Also this seems like a line straight out of an assignment. Help with homework isn't allowed, so if you want to evade that rule be creative about what you ask and how you ask for it.
Actually, it is allowed, just the rules state this:
Quote:
Do not expect LQ members to do your homework - you will learn much more by doing it yourself.
They should just be set with the expectation that homework questions won't get much help or direct answers, maybe some guidance or push them to some documentation so they learn on their own. But they're definitely allowed according to the LQ rules, as if they weren't, then that should be rephrased to accommodate such rules.
And besides, the actual question makes it seem like it could be the teacher wanting to write a script for themselves to do their own type of automated reporting, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.