PLEASE NOTE: this server, secure.csse.uwa.edu.au, will be unavailable on WEDNESDAY 7th December, from 1pm until 4pm.
Web-based programs, such as csmarks, cssubmit, and the help fora, will all be unavailable.
  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 the 2 articles in this topic
Showing 2 of 564 articles.
Currently 6 other people reading this forum.


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

Login to reply

👍?
helpful
3:35pm Thu 21st Apr, ANONYMOUS

Hello, I was wondering if someone could please help me understand some concepts $1 stands for a directory by the way for i in $1/*.py, I was wondering what /* meant? Does the $1 not already specify a directory? files=$((files + 1)), what is the $ needed after the equals sign, I understand it stands for a variable but in this case files=0 has already been defined above thanks


SVG not supported

Login to reply

👍?
helpful
10:29pm Thu 21st Apr, Michael W.

ANONYMOUS wrote:
> Hello, I was wondering if someone could please help me understand some concepts > $1 stands for a directory by the way > for i in $1/*.py, I was wondering what /* meant? Does the $1 not already specify a directory? > files=$((files + 1)), what is the $ needed after the equals sign, I understand it stands for a variable but in this case files=0 has already been defined above > thanks
Hi, This code was in a file, where $1 - the first argument - is the name of a directory. '*' matches anything, so *.py matches any file that has suffix .py . So, for i in $1/*.py is a loop where variable i is given the names of all the Python files in the directory that has been provided as the first argument. 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  1:17AM Sep 14 2022
Privacy policy