Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
