It's UWAweek 47

helpOSTS

This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 445 articles.
Currently 49 other people reading this forum.


 UWA week 15 (1st semester, week 6) ↓
SVG not supported

Login to reply

👍?
helpful
9:59am Thu 11th Apr, Michael W.

Hi Runzhi, Seeing you've asked a number of questions, I'll follow each, in turn, with my response, rather than leaving it to the end.

"Runzhi Zhao" [email protected] wrote:

Hi Professor:

I noticed that in the requirements of assignment 1, there is "Your script should only use Bash structures and the Linux commands that we have covered thus far in the unit. use any advanced Linux commands, such as sed or awk". But we have already learned commands such as "sort" and "grep" (in Lecture 04 and 06, respectively), and I would like to know if these are considered advanced Linux commands? Can we use them?

sort has been used for some time, and grep is also fairly recent, so sure. They are still "simple" Linux commands. (The distinction will become clearer when we start talking about sed and awk.)

Another question is, since we're dealing with user input errors, I'm wondering, if a user passes in a file that doesn't match the required format, but is also not zero in length, should I throw a "file not in format" error or should I let the program continue to run, even if it gives a completely unpredictable result?

A couple things there. First off, I have said that, for this assignment you can assume that every data file I use to test your code, the format will be the same. That is, the interpretation of each column won't change.

To your second point, ask yourself, "Does it make sense to continue, having established that the data is not was you expect?"

The final question is, do we need to output the error output to stderr?

Yes. That let's the user decide where to direct the two streams.

Cheers MichaelW 👨‍🎨

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy