Question: I need help with my Linux / Unix programming class. Please use the MobaXterm terminal to write the code I am having trouble following the
I need help with my Linux / Unix programming class. Please use the MobaXterm terminal to write the code I am having trouble following the given procedure guidelines. Hope you are able to help me! Thank you
OBJECTIVE: In this lab, you will learn about user-created variables and keyword variables.
Procedure: Although variables are mostly used in scripts and read by programs, you can experiment with them on the command line.
1. Assign your name to the variable named myname and use echo to display the value of myname when it is unquoted, quoted using double quotation marks, and quoted using single quotation marks.
2. Use the readonly builtin to make the myname variable you created in the previous step a readonly variable and then assign a new value to it. What happens?
3. What is the value of your HOME keyword variable?
Demonstrate that the tilde holds the same value as HOME. List the contents of your home directory using a tilde.
4. The PATH keyword variable specifies the directories in the order bash should search them when it searches for a script or program you run from the command line. What is the value of your PATH variable?
Append the absolute pathname of the bin directory that is a subdirectory of your home directory to the PATH variable. What does this change allow you to do more easily?
5. The PS1 keyword variable holds the value of your primary shell prompt. Change the value of this variable so that your prompt is simply a $ followed by a SPACE when you are working as yourself and a # followed by a SPACE when you are working with root privileges.
6. The date utility displays the date and time. Write and execute a shell script that displays the date and time, the name of your home directory, and the value of your PATH variable.
Deliverables: This lab gives you practice working with user-created variables and the HOME, PATH, and PS1 keyword variables as well as practice using the date utility.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
