It's UWAweek 17 (1st semester, week 8)

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?
75 articles posted by this person
Showing 75 of 171 articles.
Currently no other people reading this forum.


 UWA week 17 (1st semester, week 8) ↓
SVG not supported 12:44pm Fri 26th Apr, Michael W.

Hi Ziyuan, Your (and everyone's) learning is important to us, which is why we do it. When I know all the submissions have been marked, I'll figure out how to release the feedback. LMS is a complicate beast. In any case, soon. Have a good weekend Cheers M...


SVG not supported 12:00pm Fri 26th Apr, Michael W.

Hi Kai, Some material for the workshops was shuffled around, so arcade.csv is in Lab6, australian-universities.csv is in Lab8. Must put that on the list of things to tidy up for next year. Cheers MichaelW


SVG not supported 11:44am Fri 26th Apr, Michael W.

I have made Lab 6 answers visible. Lab 7 will be next week. Cheers MichaelW


SVG not supported 10:29am Wed 24th Apr, Michael W.

ANONYMOUS wrote Hi, I will say more about the final exam close to the time, but yes, as before, you will be allowed to bring a single A4 page into the exam (printed or hand-written, both sides, if you wish). Cheers MichaelW


SVG not supported 2:39pm Mon 22nd Apr, Michael W.

Hi Yu, That's fine. Cheers MichaelW


SVG not supported 11:16am Mon 22nd Apr, Michael W.

ANONYMOUS wrote Hi, Seeing all of them are the maximum, just print any one of them. Cheers MichaelW


SVG not supported 10:36am Mon 22nd Apr, Michael W.

ANONYMOUS wrote Country code should be treated the same as gender. Cheers MichaelW


SVG not supported 10:32am Mon 22nd Apr, Michael W.

ANONYMOUS wrote Yes, capitalization of country codes will be treated similar to gender. Cheers MichaelW


 UWA week 16 (1st semester, week 7) ↓
SVG not supported 4:43pm Sun 21st Apr, Michael W.

Hi, I shall respond to each in turn. ANONYMOUS wrote See earlier response (no) This was discussed in lectures See earlier threads See earlier threads The file should not end in .sh (but ok this time), but yes, any directory, which you then zip. The directo...


SVG not supported 4:37pm Sun 21st Apr, Michael W.

ANONYMOUS wrote Hi, The idea behind both discussions is that if input has a sensible reading, disregarding capitalisation, then you could logically call it a mistake, or you can use the data you've been given for full marks (if correct ). Logically, t...


SVG not supported 8:53am Sun 21st Apr, Michael W.

ANONYMOUS wrote Hi, Having multiple scripts called by the top-level one is perfectly fine; providing for that possibility is why a zip'd or gzip'd directory is required for the submitted program. However, please do not have you own call to chmod. The ...


SVG not supported 8:51pm Sat 20th Apr, Michael W.

ANONYMOUS wrote Hi, The first argument is the full pathname to the file, which the testing program will supply. All your program has to do is open the file associated with 1; if it's not there, the program should simply stop and print an error messag...


SVG not supported 2:27pm Sat 20th Apr, Michael W.

Hi Anandhu, The testing script will set everything up for so please do not change the PATH variable. Cheers MichaelW


SVG not supported 2:24pm Fri 19th Apr, Michael W.

Hi, I think you'll find the answer to that in earlier threads. (You'll note that helpOSTS provides a string search facility.) Cheers MichaelW


SVG not supported 2:22pm Fri 19th Apr, Michael W.

Hi Alexandra, Given the actual range of survey dates, and the fact that we are coding this now, I took the pragmatic view that 2022 (and earlier) is past, while 2025 is future. Still, nice idea. Cheers MichaelW


SVG not supported 2:19pm Fri 19th Apr, Michael W.


SVG not supported 8:47am Fri 19th Apr, Michael W.

Hi Zichen, It just means that whatever you did was submitted as is, so that's all that will be marked. Does it matter? Not really, given the context. (I'll set it up differently next time.) Cheers MichaelW


SVG not supported 8:44am Fri 19th Apr, Michael W.

ANONYMOUS wrote Hi, I have no idea how or why one might use the find command in a situation where the input data consists of a single file (not directory). More to the point, you have to be very careful with find as the command can traverse a lot of f...


SVG not supported 1:58pm Thu 18th Apr, Michael W.

Hi, We've only just covered it. As I mentioned a while back, I release solutions a couple weeks after the week when the lab would cover the lecture, to give people time to try it. I've recently released the solutions for Lab 5. (Congratulations on bei...


SVG not supported 12:22pm Thu 18th Apr, Michael W.

Hi, That is correct, so there must be a different way. (See next response). Cheers MichaelW


SVG not supported 12:21pm Thu 18th Apr, Michael W.

ANONYMOUS wrote Hi What I was trying to indicate is that treating malE as an error is not wrong, but does make use of perfectly usable information, so would be worth less as an answer, therefore half marks for that question. Cheers MichaelW


SVG not supported 10:28pm Wed 17th Apr, Michael W.

Hi Suan Not quite echo 'fred cat' sed -e 's a-z a-z ' The single quote are also important (to top the info for sed being instead processed by Bash. Cheers MichaelW


SVG not supported 8:39pm Wed 17th Apr, Michael W.

Hi, Please see my responses to the earlier thread "Assignment 1 Use of BC". Short answer, No. For the reasons, please read the thread. Cheers MichaelW


SVG not supported 8:33pm Wed 17th Apr, Michael W.

ANONYMOUS wrote Hi, Please see my reply to the earlier thread, unhelpfully entitled, "doubts in assignment" Cheers MichaelW


SVG not supported 8:20pm Wed 17th Apr, Michael W.

ANONYMOUS wrote Hi, In the words of Han Solo, I have a bad feeling about this . (My apologies if I'm being unfair.) Please make sure your script works on the standard environment provided by either the Docker class image, or Linux Lab in the UniAp...


SVG not supported 8:13pm Wed 17th Apr, Michael W.

Hi, I'll answer each part after the question ANONYMOUS wrote I hope it's clear that I'm expecting the program to deal with other error states. Given that I've not told you what they are, I can hardly be pedantic about the error message. True? While you...


SVG not supported 8:05pm Wed 17th Apr, Michael W.

ANONYMOUS wrote Hi, One thing you need to learn is that if something is made explicit in a specification, typically because it needs to work with other modules then you must keep to the spec. However, just this time, I shall accept tobacco nation or t...


SVG not supported 8:00pm Wed 17th Apr, Michael W.

Hi, It's way too early to talk about the final exam, and the truth is that I've not designed it yet. There will be a past exam you can look at, which we'll also discuss in class. As you mention, you will be allowed to bring in a single sheet of A4 pap...


SVG not supported 7:49pm Wed 17th Apr, Michael W.

Hi Eusha L1 to L9 (so not Ed style regular expressions) are covered. Cheers MichaelW


SVG not supported 7:34pm Wed 17th Apr, Michael W.

ANONYMOUS wrote The best hint I can offer, short of spelling it out, is to go back to the lectures L1 to L6 (including L5, though the order was swapped). While the efficiency will be poor, you only need to use the language structures and Unix command...


SVG not supported 2:25pm Mon 15th Apr, Michael W.

Hi Junyu Just pick one. (They are all correct, after all). Cheers MichaelW


SVG not supported 2:07pm Mon 15th Apr, Michael W.

Hi Kaichao, Try again now, please. Cheers MichaelW


SVG not supported 1:59pm Mon 15th Apr, Michael W.

Hi Kaichao, I cannot see why there is a problem, so I've extended the test till tomorrow, 11 59pm and will ask IT for help. Thanks for letting me know Cheers MichaelW


SVG not supported 1:54pm Mon 15th Apr, Michael W.

Hi Kaichao Oh dear. I was in a workshop till now, but I'll go right now and see what is happening. Cheers MichaelW


 UWA week 15 (1st semester, week 6) ↓
SVG not supported 7:45pm Thu 11th Apr, Michael W.

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


SVG not supported 7:43pm Thu 11th Apr, Michael W.

Hi Aadil, Yes, same order. Cheers MichaelW


SVG not supported 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. sort has been used for some time, and grep is also fairly recent, so sure. They are still "simple" Linux commands. (Th...


SVG not supported 3:08pm Wed 10th Apr, Michael W.

My reasoning is, quite simply, does the different rendering still have an unambiguous interpretation? Cheers MichaelW


SVG not supported 3:06pm Wed 10th Apr, Michael W.

Hi Eusha, Done. For good measure, I also uploaded the code that was created for L6 and today's lecture, L9. Enjoy ... (ok, perhaps not, but I hope you find it useful). Cheers MichaelW


SVG not supported 3:56pm Mon 8th Apr, Michael W.

Hi Everyone, I realised that the lecture did not define what a Bash while loop is, beyond the examples. I have now revised the lecture slides (and PDF) to include a slide on what a while loop looks like, and how it works. I also took the opportunity to...


SVG not supported 3:04pm Mon 8th Apr, Michael W.

Hi Everyone, This is in response to some questions I was asked in the lab. What if the user types male rather than the expected Male? My attitude to error handling is quite pragmatic - Is there a sensible interpretation of the input data that is close...


SVG not supported 10:46am Mon 8th Apr, Michael W.

ANONYMOUS wrote Hi ) The name of the directory containing the script can be anything. ) You don't need to include the .csv file, as I shall be using my own. However, no harm done if you do include it; I'll simply ignore it. ) Don't worry about file ...


SVG not supported 10:19am Mon 8th Apr, Michael W.

Hi, The number of white spaces is not relevant; I believe in auto-testing (for uniformity and fairness), but not auto-marking, because humans are much better at dealing with differences in the output that are actually not relevant. In particular, diff...


SVG not supported 10:15am Mon 8th Apr, Michael W.

Hi Kushan The spec says, "We will not be using Both, which is the mean of the Famale and Male smoking rates" Cheers MichaelW


SVG not supported 10:12am Mon 8th Apr, Michael W.

Hi, I discussed dev stderr in response to another query. Please look there. Regarding the file name, the specification says that the name has to be tobacco nation (with no suffix). However, people find it very hard not to add a .sh, so - while techni...


SVG not supported 10:08am Mon 8th Apr, Michael W.

Hi, There is a little confusion here. For all Bash messages you need to use echo. The only question then is where the message is to be printed. echo "Fred here" will print to stdout (or dev stdout). That is the default destination, so you don't have ...


 UWA week 14 (1st semester, non-teaching week) ↓
SVG not supported 3:28pm Sat 6th Apr, Michael W.

Hi Rabea, Use of Bash functions is fine; It's just that we've not covered them yet. The are not "advanced" (I really should have chosen a different word), by which I intended more advanced Unix tools, such as awk (and bc), where you can pretty much ge...


SVG not supported 3:21pm Sat 6th Apr, Michael W.

Using gzip (and then gunzip) on the directory containing the script(s) is also fine. In retrospect, given that I've been pushing Unix Linux specific tools, for authenticity I really should have asked for Linux native gzip over the more optional zip. ...


SVG not supported 9:39am Fri 5th Apr, Michael W.

Hi Suan, For example, let's say that the argument to this program is a word 1 being sought in a text 2 if grep 1 2 dev null then echo "The word 1 is found in 2" else echo "The word 1 is not found in 2" fi In this case we don't want ...


SVG not supported 2:45pm Thu 4th Apr, Michael W.

Hi, This makes no sense to me. If you are able to capture a floating point real in this way (outside of Awk), you will comparing strings, which is not a good idea if you actually are working with numbers (see the discussion on arithmetic versus string...


SVG not supported 9:35am Thu 4th Apr, Michael W.

Hi Nathan, Textbook? How wonderfully old-fashioned . Which one are you using, please? Cheers MichaelW


SVG not supported 4:12pm Wed 3rd Apr, Michael W.

ANONYMOUS wrote Hi, If you are running the standard Ubuntu Bash Gnu-Shell-Tools set up, having the .sh on the end of file name should not matter. Instead you need the usr bin env bash as the first line. (To my taste, having .sh at the end of Shell ...


SVG not supported 4:07pm Wed 3rd Apr, Michael W.

Hi Suman, I don't really understand the question. Bash printf prints data to standard output. I can't see how you can use Bash's printf to compare floating point values. Sorry. Confused. (Bash only supports integer arithmetic - which we'll cover short...


SVG not supported 8:54pm Tue 2nd Apr, Michael W.

Hi, Sorry for being unclear, no, you cannot use bc. Cheers MichaelW


SVG not supported 12:21pm Tue 2nd Apr, Michael W.

Hi Baoyue, Please go back over Lecture 5 Variables, particularly the material on the PATH variable. You will notice I have put '.' in my PATH, so did not have to explicitly use . count occurrences. Cheers MichaelW


SVG not supported 12:15pm Tue 2nd Apr, Michael W.

Hi, I wouldn't class the read command as advanced. It's just that we've not covered it yet as it's related to loop structures, which we only get to do next teaching week. Please just use the stuff we've covered - for now. Trainer-wheels will come off...


SVG not supported 11:44am Tue 2nd Apr, Michael W.

Hi Nathan, short answers are No and Yes. Longer answer, bc is a small language similar to awk in concept, though more limited. The point of this assignment is get you using the language structures we have covered in the unit, literate programming, an...


 UWA week 13 (1st semester, week 5) ↓
SVG not supported 4:01pm Wed 27th Mar, Michael W.

Hi Suan, They are both places where standard output, e.g. from echo, can be redirected. dev stderr (don't forget the first ' ' ) is standard error output (for error messages), while dev null is literally nowhere, a black hole, which simply gobbles u...


SVG not supported
lab4   (both)
12:23pm Wed 27th Mar, Michael W.

Hi Suan A better way of saying 1 2 echo ERROR is echo ERROR dev stderr The first of these can be used by all Unixes Linuxes, but is very unobvious syntactically; translation take the output sent to stdout (file descriptor 1) and send it instead t...


SVG not supported 12:02pm Wed 27th Mar, Michael W.

ANONYMOUS wrote Hi, I have no idea why you are unable to submit your Assignment 1 file, as 6 people have managed to do so, including 2 just today. All I can suggest is please try again. Cheers MichaelW


SVG not supported 9:36am Tue 26th Mar, Michael W.

Hi, I'll talk about that tomorrow (Wed 27th), but the specification says that what the program should expect is a 3 letter ISO country code. Cheers MichaelW


SVG not supported 9:33am Tue 26th Mar, Michael W.

Hi Zichen, Unless I'm missing something, I think I covered that in yesterday's (Monday 25th) lecture on where binaries are to be found, and the PATH variable. No? Cheers MichaelW


SVG not supported 10:21am Mon 25th Mar, Michael W.

Hi Everyone, Given the questions I'm being asked about Assignment 1, I plan to use the first part of the lecture on Wednesday (27th) as a Q A about Ass 1, so BYO Questions. I'll also show you a useful command for tracking through your program as it ex...


 UWA week 12 (1st semester, week 4) ↓
SVG not supported 9:51am Fri 22nd Mar, Michael W.

ANONYMOUS wrote Hi, The range column is actually not relevant for this assignment, and the maths you suggest is well beyond the tools that I have asked you to use. Please just use the medianPC for the calculations. Cheers MichaelW


SVG not supported 9:36am Thu 21st Mar, Michael W.

Hi Eusha, Yes, it would be okay to ignore the output format in this particularly. Clearly my intention was to have Male where I would otherwise have Female, but I forgot to do that in my implementation and therefore in the examples. To be honest, I wo...


SVG not supported 9:34pm Wed 20th Mar, Michael W.

Yes, tobacco nation and . tobacco nation are intended to be the same variable. This will be made clear at Monday's lecture, and - long story short - involves how you set up the PATH variable. Starting with the . is arguably better (which is anothe...


SVG not supported 10:43pm Tue 19th Mar, Michael W.

Hi Everyone, You are aware that we don't have a lecture tomorrow morning (9am March 20). What I strongly suggest you do is make sure you have had a go at Labsheet 3. The language structures covered there are directly relevant to Assignment 1, and whil...


SVG not supported 10:35pm Tue 19th Mar, Michael W.

Hi Suan, Don't worry. I engineered some slack in the timetable to deal with these interruptions, or simply the fact that I want to go more slowly over something, or spend the time answering questions. If you get on LMS you'll see that the Weekly sched...


SVG not supported 9:55am Tue 19th Mar, Michael W.

Hi Everyone, What I usually do if I receive an email query whose answer could apply to the whole, is reply to the sender and then post the answer as a FAQ. Here is the first. Cheers MichaelW ... " I saw there are 2 spaces in some of your examples in the d...


SVG not supported 9:46am Tue 19th Mar, Michael W.

Onto it. See you next Monday.


SVG not supported 9:44am Tue 19th Mar, Michael W.

Hi Kaichao, wc is very simple it just counts the number of characters, words and lines in a plain-text file. In general, if you are unsure about any command, I recommend using man, e.g. man wc Finally, beware of using ChatGPT for anything; it can "hall...


 UWA week 11 (1st semester, week 3) ↓
SVG not supported 5:39pm Sun 17th Mar, Michael W.

Hi Zeke, This is what I'll be talking about in tomorrow (Monday's) lecture, and why I brought that lecture forward. As they say, All Will be Revealed ...... (cue the dramatic music) Cheers MichaelW


SVG not supported 5:36pm Sun 17th Mar, Michael W.

Hi Suan, It looks like you are using Windows System for Linux (due to the Windows-format pathnae), rather than Linux itself, which you can get via the Docker image, or download and install UniApps and search for Linux Lab. Cheers MichaelW


SVG not supported 5:31pm Sun 17th Mar, Michael W.

Hi Weng That is entirely fair and reasonable. It should be included. However, I know from experience that classes hate it when the specification of an assignment is changed after it has been released. I'll therefore leave the specification as it is. I...


SVG not supported 5:24pm Sat 16th Mar, Michael W.

Welcome to helpOSTS I've now tried the two class discussion systems available on LMS Discussion Forums and Wiki. Neither is suitable, as far as I'm concerned. The Discussion Forums are only for topics set by the unit coordinator, and are used in ca...

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