Search for question
Question

INSTRUCTIONS Create a directory called ~/myscripts Use your favorite text editor (e.g. vi) to create a new file under the folder created in (1) above, name it greetings.sh Add a few basic commands to your script, for example, to display a welcome statement using the echo command and display the current date using the date command. Do not forget to begin with the statement #!/bin/bash Save and Make Executable Display the content of the file and permissions on greetings.sh - take a screenshot. Test your script to ensure it is working as per (3) above. Take a screenshot. We are going to edit the .bashrc file, but before you edit the file, it is a good practice to make a copy of the file. You will create a copy of the .bashrc file called .bashrc.backup, — copy this file to your home folder open the bashrc and add a PATH variable to include your scripts directory path. Please remember to use $PATH:[your path], otherwise the current PATH will be overwritten and you won't be able to run any commands. Save the bashrc file. - Display the contents of the .bashrc using an appropriate command – take a screenshot to show the edits you made to the file Use the source command to apply the changes. Use an appropriate command to display the PATH variable on the command line - take a screenshot. Change the directory to/ - and run your script from the root directory without including the absolute path to the script Take a screenshot to demonstrate this Create an alias for the script 'greetings.sh' - for example ' when type 'sayhello' on the command line, this should execute the greetings.sh script. Take screenshots to demonstrate this use the awk command to list all alias statements in the .bashrc file - take a screenshot use the sed command to change the alias 'sayhello' to 'hithere', and send output to .bashrc.copy - take a screenshot to command used and the change Submission Submit all the screenshots