You have created a script that reads the data from ‘Colours.txt’ file and displays it on the terminal.
After running the script, you get the “No such file or directory” message.
What steps would you need to take to debug this script?
The first step is to check if the ‘Colours.txt’ file exists. If not use a text editor to create ‘Colours.txt’ file with data inside it.
The second step is to check if the ‘Colours.txt’ file in the same location where the script is. If not, then either move the ‘Colours.txt’ file inside the same location of the script or specify the full location of the ‘Colours.txt’ file inside the script.
The third step is to check if the ‘Colours.txt’ file has read permission for the script to read the data from it. If not, then use the ‘chmod’ command set the read permission of the ‘Colours.txt’ file.