Answered step by step
Verified Expert Solution
Link Copied!

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 DOG=Shepherd 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=10+2*7 b. Print the content of X c. Assign (X+2*4) 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 $MY_VAR c. Make the script executable d. Assign the value 2 to MY_VAR e. Execute the script. What do you see? f. Type export MY_VAR g. Execute the script again. What do you see now? Use the grep command to find the username rtml0007 in /etc/passwd: grep -i "rtml0007"/etc/passwd Write a shell script that prompts the username to be entered as a command line argument and call it user: grep -i "$1"/etc/passwd Exercise 7 Introduction to shell scripting 6.7. Run the script as follows: a. user rtml0007 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 /etc/passwd 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions