It's UWAweek 18 (1st semester, week 9)

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 the 4 articles in this topic
Showing 4 of 179 articles.
Currently 1 other person reading this forum.


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

Login to reply

👍?
helpful
12:29am Thu 11th Apr, Runzhi Z.

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?

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?

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

Thank you for your attention to this request!


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 👨‍🎨


SVG not supported

Login to reply

👍?
helpful
5:17pm Thu 11th Apr, Eusha K.

Hello Mr.Wise,

Would it be okay to keep the error messages in stdout? (i.e, with no redirections by default)

Thanks.


SVG not supported

Login to reply

👍?
helpful
7:45pm Thu 11th Apr, Michael W.

Hi Eusha I think I answered that for Runzhi, above.

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  5:07AM Sep 06 2023
Privacy policy