Answered step by step
Verified Expert Solution
Question
1 Approved Answer
part 2/3 CHAPTER 8, LAB 2: SHELL PARAMETERS AND VARIABLES (15 MINUTES) LEARNING OBJectives ANd OUtComes In this lab you will learn about enercreased variables
part 2/3
CHAPTER 8, LAB 2: SHELL PARAMETERS AND VARIABLES (15 MINUTES) LEARNING OBJectives ANd OUtComes In this lab you will learn about enercreased variables and lieywond variakles. READING Read "Parameters and Variahles" on page 300 of Sobell up to "Pathname capancin in assifntments" an page 303 . Procedure Alrhogsh variables are mostly aned is seripes and read by peoprams, you can meperiment with them on the coetumand line. 1. Assipn your name to the wariable named myname and use tho to depplay rhe valae of myrame when ir is unqooted, quoted vating deuble quotarion marka, and quoted iaing single quotation marks. (Kefer to -Parameter subSebbelli.) 2. Uive the soadonly (3obell, fabe 305) truiltin to make alse myname variable you creaced in the previeus step a readonly variable and shen asaign a new value to if. What happens? 3. What is the value of yoar HOME (Sohell, page 307 ) kerperd variablet Denoesurate that the eilde (-s Sobell, page 3077 ) molds the name vallat as HOME. List the contents of your home direstory using a tilde. 4. The PATH (Solbell, jage 306) keyword vaniable spevifies the ditnonoies in the erder bash should searh them whin it keatehes for a seripe of progeram yoa ran from the command line. What is the valat of your PAIH rarialle? Append the ahvolute pathaname of the bia direstory that is a sabdirectury of your home directory to the RATH variable. What does this chance allow you to do mone easily? 5. The PS1 (Solell, page 309) keword vaniakle holds the value ef your promary shell prompe. Change the value of this sariable so that your prompt is simply a 5 followed by a spies when you aee working as yourself and a t followed by a PRK\& when you are woeking with root priviltees. 6. The date (Sobell, pape 62) unility daplays the date and rime. Write and evecure at shell scrige that dreplays the dane and eime, the naitse of your boeme directory, aed the value of yoar PAIII variable. 22 Las rok. A Pacticai Guide to Linux Commanes, Eomors, and Smia, Progedmuing ar Mare G. Soenc. DELIVERABLES This lab grives you peactice werking with user-ceeaned variahles and the HOME. PATH4 and PS1 keyword variables as woll as practice aving the date erilify Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started