Bonus

Bonus Exercise

In the previous Bash: Introduction - Demo article the instructor presented a demo consisting of:

  • Creating a new bin directory in the current user’s home directory
  • Creating a new bash file called whattimeisit
  • Adding the shebang (#!/bin/bash) instructing the OS to run the file using the bash interpreter on the first line
  • Adding three separate echo commands to the bash file
  • Saving and exiting the file
  • executing the bash file using the bash command
  • adding executable permissions to the file
  • executing the bash file by invoking the name both using a relative path and an absolute path

These are all steps you can now perform with your new found Bash: File System Navigation and File/Directory CRUD skills!

Additional Bonus

You can also complete the rest of the steps from the Bash: Introduction - Demo .

Note

You are not expected to know about manually changing the $PATH shell variable, Symlinks, or how to use the ln command, but you can do your own research to learn about these concepts and commands. Being able to look up and use various commands is a very important skill to develop within the tech industry!

General Steps

  • add the /home/student/bin directory to the $PATH variable
  • create a symlink named when that points at the whattimeisit bash script
  • invoke both when and whattimeisit to show how they work

Additional Bonus: Question & Answer

What happens if you close your terminal and try to run when and whattimeisit?

CLICK FOR ANSWER