Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create variables and assigning a value to it: a . Type DOG = Shepherd and press enter b . Type echo DOG and press enter.
Create variables and assigning a value to it: a Type DOGShepherd and press enter b Type echo DOG and press enter. What do you see? c Type echo $DOG. What do you see? d Create variable call it MEMO and assign the value Meeting will be today at noon f e Show the variable name Print the content of it Practice arithmetic operations a Type let X b Print the content of X c Assign X to the variable Y d Print the content of Y The export command a Create a script called testscript b Its content will be : echo $MYVAR c Make the script executable d Assign the value to MYVAR e Execute the script. What do you see? f Type export MYVAR g Execute the script again. What do you see now? Use the grep command to find the username rtml in etcpasswd: grep i rtmletcpasswd Write a shell script that prompts the username to be entered as a command line argument and call it user: grep i $etcpasswd Exercise Introduction to shell scripting Run the script as follows: a user rtml b user fielder Change your program to prompt the user for a name to search for in the telephone book. Your program should now look something like the following: echo "Enter a name to search for: read name grep i $name etcpasswd now run the script and enter your user name to be searched for.
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