ANONYMOUS wrote:
> Hello professor,
> I've doubt about searching file into the system. as you mention in the assignment that, user will pass "tobacco_nation <csv data file> < year | country code > < Male | Female >" so, can i assume that whenever user pass the file name, user always provide the full path where file is located.
>
> for example :
> 1. tobacco_nation "WHO_tobacco_control_tonly.csv" 2000 Male
> or
> 2. tobacco_nation "~/stud/perm/WHO_tobacco_control_tonly.csv" 2000 Male
>
> Currently i'm assuming 1st scenario. that's why i used find command to search file in whole system.
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 message (which is the fifth example). While I now appreciate where you are coming from, finding a random file somewhere in the file-space with the same name may not be helpful. Better to keep things simple. After all, if the user gives you the path to a file which does not exist, it's their problem.
Cheers
MichaelW
👨🎨