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