It's UWAweek 25 (mid-year break)

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 15 articles in this topic
Showing 15 of 439 articles.
Currently 8 other people reading this forum.


 UWA week 14 (1st semester, non-teaching week) ↓
SVG not supported

Login to reply

👍?
helpful
2:30pm Mon 1st Apr, Nathan R.

Is BC allowed as part of our code or is BC classed as something "advanced" and using it will limit our score to a maximum of 12?


SVG not supported

Login to reply

👍?
helpful
11:44am Tue 2nd Apr, Michael W.

"Nathan Reed" <24*1*0*4@s*u*e*t*u*a*e*u*a*> wrote:
> Is BC allowed as part of our code or is BC classed as something "advanced" and using it will limit our score to a maximum of 12?
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, antibugging, etc. In addition, ise of more advanced (for now) features unfairly disadvantages those who really are tackling the material for the first time. Fair enough? Cheers MichaelW 🧑‍🎨


SVG not supported

Login to reply

👍?
helpful
11:46am Tue 2nd Apr, ANONYMOUS

To also add to this, can we use the read command? or is this also classified as "advanced"? Thanks


SVG not supported

Login to reply

👍?
helpful
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, or at least will be substantially reduced - for the second assignment. Cheers MichaelW


SVG not supported

Login to reply

👍?
helpful
5:55pm Tue 2nd Apr, ANONYMOUS

"Michael Wise" <mi*h*e*.*i*e@u*a*e*u*a*> wrote:
> "Nathan Reed" <24*1*0*4@s*u*e*t*u*a*e*u*a*> wrote: > > > Is BC allowed as part of our code or is BC classed as something "advanced" and using it will limit our score to a maximum of 12? > > 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, antibugging, etc. In addition, ise of more advanced (for now) features unfairly disadvantages those who really are tackling the material for the first time. Fair enough? > > Cheers > MichaelW > 🧑‍🎨
Thank you for this professor, I am still confused that can we use bc or no, Kindly respond because in one condition without using bc I am facing issue.


SVG not supported

Login to reply

👍?
helpful
8:54pm Tue 2nd Apr, Michael W.

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


SVG not supported

Login to reply

👍?
helpful
2:59pm Wed 3rd Apr, Suman I.

Hi Sir, Thank you for the response, I have one more question, Can I use scaling like printf "%.0f" to compare floating point values


SVG not supported

Login to reply

👍?
helpful
3:04pm Wed 3rd Apr, ANONYMOUS

Also one more question in the below sample .sh for file has not been included, is it necessary to remove it because, when I am running on my system I need to add .sh or else I have error. Kindly clear my this doubt % tobacco_nation WHO_tobacco_control_tonly.csv 2030 Female The global maximum percentage of Female tobacco users in 2030 is predicted to be in Andorra (AND) at 42.3


SVG not supported

Login to reply

👍?
helpful
4:07pm Wed 3rd Apr, Michael W.

"Suman Inamdar" <23*9*4*9@s*u*e*t*u*a*e*u*a*> wrote:
> Hi Sir, > Thank you for the response, I have one more question, Can I use scaling like printf "%.0f" to compare floating point values
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 shortly Cheers MichaelW


SVG not supported

Login to reply

👍?
helpful
4:12pm Wed 3rd Apr, Michael W.

ANONYMOUS wrote:
> Also one more question in the below sample .sh for file has not been included, is it necessary to remove it because, when I am running on my system I need to add .sh or else I have error. > Kindly clear my this doubt > > % tobacco_nation WHO_tobacco_control_tonly.csv 2030 Female > The global maximum percentage of Female tobacco users in 2030 is predicted to be in Andorra (AND) at 42.3
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 script is misleading unless you intend to use sh (ie the original Shell, of which Bash is a derivative.). Cheers MichaelW


SVG not supported

Login to reply

👍?
helpful
7:17am Thu 4th Apr, Nathan R.

Thanks for clarifying Michael. I've gotten ahead of myself with the textbook ;-). Will find a new solution!


SVG not supported

Login to reply

👍?
helpful
9:35am Thu 4th Apr, Michael W.

"Nathan Reed" <24*1*0*4@s*u*e*t*u*a*e*u*a*> wrote:
> Thanks for clarifying Michael. I've gotten ahead of myself with the textbook ;-). Will find a new solution!
Hi Nathan, Textbook? How wonderfully old-fashioned 😉👍. Which one are you using, please? Cheers MichaelW 🧑‍🎨


SVG not supported

Login to reply

👍?
helpful
1:20pm Thu 4th Apr, ANONYMOUS

Hi, Thank you for the response, I mean I can convert it into int first without decimal like printf "%.0f", variablename and store it in other variable and then compare. just let me know if this can be valid


SVG not supported

Login to reply

👍?
helpful
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 comparisons). Cheers MichaelW


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

Login to reply

👍?
helpful
1:26pm Thu 11th Apr, Nathan R.

Hi Michael, I've been using "The Linux Command Line" (5th Edition) by William Shotts.

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