PLEASE NOTE: the upgrades to this server, secure.csse.uwa.edu.au, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49

help2003/help4407

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 564 articles.
Currently 3 other people reading this forum.


 UWA week 17 (1st semester, week 8) ↓
SVG not supported

Login to reply

👍x3
helpful
3:36pm Fri 29th Apr, ANONYMOUS

ANONYMOUS wrote:

You should be able to call the python file like any other script, within your shell script. Eg. python_file "text"

It just takes an input, returns an output.

It should be noted that this only works if you update your path; according to Michael, this requires you including ".", allowing you to call title_case.py from anywhere in the docker. (See Michael's answer https://secure.csse.uwa.edu.au/run/help4407?p=np&opt=B158)

This, however, is considered (very) bad practice and is consistently advised against in Unix circles. https://unix.stackexchange.com/questions/65700/is-it-safe-to-add-to-my-path-how-come.

If you are wondering how to use the script in your code, once you have done the above (don't do that) the intention is that you would have a line in your shell script along the lines of:

# Anti-bugging here to determine this is a string
country=$1
capitalised_country="$(title_case $country)"
# Find the capitalised_country  (and a strong coffee)

Hence if we ran ./malaria_incidence belize, the above would convert belize to Belize, and thus be able to locate the capitalised Belize in the incidenceOfMalaria.csv.

As has been identified above, however, this seems unnecessary given that grep -i will find Belize from bElIzE. This makes it unclear as to what method Michael is expecting to be used, as if you are using grep this is unnecessary...

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  1:17AM Sep 14 2022
Privacy policy