---
# System prepended metadata

title: 'WEEK 3 '

---

### THE WEEK THAT ALMOST ENDED IT
Week three was by far the most intense in the journey here at Blockfuse labs. 

Monday was a summary of the previous week's assignments and learning matrierls then we created couple of scenarios  to use bash scripting in real life problem solving such as entering student test scores to get their respective grades, greeting commands and conditional statements and the use of loops (while and if loops).

Wednesday was more of Monday with  a car engine scenario where we had to use logic in creating a nested while loop to solve the problem. We then created a user aunthentication problem and i learnt the importance of using read command and variables.
I had challenges with my code as it kept failing due to a slight error on my part (logical error) but was able to eventually understand the reasoning.

On Friday we went over the engine assignment, tried more applications of while and if loops, learnt the use and applciation of modulus (modular arithmetic) in solving problems (I at this point began to realise why we were told software engineering is a problem solving career and not code writing). I learnt about the two types of errors; logical and syntax error and how logical errors are the most difficult to troubleshoot and eventually I was preparing for closing time when the Founder came in to give a surprise eviction test.

The test was pretty easy especially the first part which was to create a script that would prompt user to enter name of directory, create a file inside the directory and list the content of the directory.
The second part however which was to create another script that prompts user to enter absolute filepath, prompt to enter file name, and remove the file; gave me a much more difficult time (over 15 minutes) due to a very simple error in assigning variable on my part.
My script was this;
```
#!/bin/bash

echo "Please enter absolute filepath"
read PATH

echo "Please enter filename"
read FILENAME

rm $PATH/$FILENAME
```
I kept receiving an error on my terminal "rm command not found" and it was shocking to me as i had used the rm command multiple times in the last three weeks. I changed the "rm" to "rm -r", "rm -rf" and kept getting same "rm command not found error" and was in total disbelief and full panic mode.
I eventually came to figure out that macOs like all UNIX like system has a reserved system environment variable called PATH used by the shell to locate executable files and I was accidentally overwriting the system environment variable PATH, which is critical in telling my shell where to find system commands like rm. Overwriting it made commands such as rm, ls, pwd, etc. no longer available in that session.
Changing the variable to "FILE_PATH" made the code execute successfully and I was able to finish and be among the five individuals who passed the eviction test.

The test was a wake up call to take the classes more seriously although the outcome of majority of my colleagues failing is that our class schedules have now been adjusted to five days a week 8am - 5pm. 

How I will cope with this and my other responsibilies most importantly my remote data annotation job is left to be seen.


