- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: bash shell error checking
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 05:21 PM
тАО06-07-2003 05:21 PM
bash shell error checking
ive been working on this code (on unix) which reads a text file(which has student user names and marks etc), then i output real names, and total marks, averages etc
my problem is error checking tho
my arguments are
report.sh -e marks.txt
(which prints output, and count of grades and averages)
report.sh -s marks.txt
(which just prints the output)
i need error messages for the following cases
*where the data file does not exist
*an incorrect command switch is used
*a command switch is not provided
*a data file is not provided
can someone help me here, i will send u my source code,
the textfile is like this:
*i had some smaller problems, my averages and counts of grades seem to count cumulatively, how to i get it to print just the final counts, or the last average?
*i also needed to sort the output from largest to smallest total marks (without using a temp file) how can this be done?
hope im not too much bother, can someone please look at this and help within the 24 hours, im under a strict deadline and im startin to panic, thanks everyone
hope ya's can help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 05:23 PM
тАО06-07-2003 05:23 PM
Re: bash shell error checking
it is based on usernames and student numbers on my unix system
but they all work, so its irrelevant to what i need
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 09:29 PM
тАО06-07-2003 09:29 PM
Re: bash shell error checking
Okay, give me a few days to squeeze this in and I'll even optimize it for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 09:35 PM
тАО06-07-2003 09:35 PM
Re: bash shell error checking
:(
id hate to be a bother, but i need this done in less then 24 hours
could u just work out how to do the sorting and error checking
and if u have time the other things?
please that would be great
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 09:36 PM
тАО06-07-2003 09:36 PM
Re: bash shell error checking
:(
id hate to be a bother, but i need this done in less then 24 hours
could u just work out how to do the sorting and error checking
and if u have time the other things?
please that would be great
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 09:38 PM
тАО06-07-2003 09:38 PM
Re: bash shell error checking
:(
id hate to be a bother, but i need this done in less then 24 hours
badly......
could u just work out how to do the sorting and error checking
and if u have time the other things?
please that would be great
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2003 09:52 PM
тАО06-07-2003 09:52 PM
Re: bash shell error checking
but yeh, i have exactly 18 hours to finish this thing (damn deadlines)
r u able to do any of it by then?
i hope u can
i wont be able to thank u enough if u do
get back to me ASAP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2003 05:54 PM
тАО06-08-2003 05:54 PM
Re: bash shell error checking
I'll try to get this to you before I go to sleep tonight. I'm currently hung-up on some bash array processing. I'd send you what I've whipped up so far, but I've lost connectivity to my work environments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2003 10:16 PM
тАО06-08-2003 10:16 PM
Re: bash shell error checking
This is what I have so far.
Unfortunately, the grade counters are not incrementing and I haven't even touched the averaging and sorting logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2003 04:02 PM
тАО06-09-2003 04:02 PM
Re: bash shell error checking
Revision 2 is attached. 50% rewritten.
Grade counts and overall average included. Still not sure how to sort the grades yet.
For whatever reason the grades array would not propogate to the get_grade function. So instead of trying to get this function to increment each grade element, I decided to have the parent FOR loop increment the elements using the return code of the function as the index.
I'm sure you'll have a lot of questions about what is what and how it works. So do ask.