Question: UNIX/LINUX Although variables are mostly used in scripts and read by programs, you can experiment with them on the command line. i. Assign your name
UNIX/LINUX
Although variables are mostly used in scripts and read by programs, you can experiment with them on the command line.
i. 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.
ii. Read the man page for the readonly command (man readonly) to understand its use. Now use the readonly builtin to make the myname variable you created in the previous step a read-only variable and then attempt to assign a new value to it. What happens?
iii. Your HOME keyword variable
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.
iv. The PATH keyword variable specifies the directories in the order bash should search them when you run a script or program from the command line.
What is the value of your PATH variable?
Append the absolute pathname of the myprogs directory that is a subdirectory of your home directory to the PATH variable. What does this change allow you to do more easily? (Hint: You can use a variable while defining a variable.)
v. Append the absolute pathname of the myprogs directory that is a subdirectory of your home directory to the PATH variable. What does this change allow you to do more easily? (Hint: You can use a variable while defining a variable.)
Display the values of the HOSTNAME, MAIL, PWD, and USER variables
Create an alias such that when you type lt, the command displays a long, recursive listing of all files in the directory (e.g., lt Unit6 would display a long, recursive listing of the Unit6 directory hierarchy).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
