Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Please give me step by step command direction on how to get this to work from beginning to end. Please help me. Shell variables Unix

Please give me step by step command direction on how to get this to work from beginning to end. Please help me.

image text in transcribedimage text in transcribed

Shell variables Unix shells allow you to create named variables that act as pointer to assigned value. This value can be text, number, filename or device. A variable name can contain only letter, numbers and underscore. However, the convention is to use uppercase letters. Special characters (e.g. !, * or -) cannot be use in names since they have special meanings. Example: MY_NAME="John Doe" Such variables that can hold only one value are called scalar variables. To access the value stored in a variable, prefix its name with the dollar sign ($) Example: echo $MY_NAME MY NAME="John Doe"; echo $MY NAME Create a shell script using above example to display your name on screen. Positional variables (or parameters) The value of a positional parameter or positional variable is set from an argument specified on the command line that invokes the program. Positional parameters are numbered and are referred to with a preceding dollar sign ($) e.g. $1, $2, $3. Example: echo $1 Create a shell script that accepts your name as argument and displays it on screen. Copy your script from previous procedure and rename it to reflect for this procedure. Modify it to display following output: Hello, my name is Copy your script from previous procedure and rename it to reflect for this procedure. Modify it to accept a 2nd argument for your age and display output as follows: Hello, my name is . My age is Environment Variables You can use environment variables in shell scripts as well. Example: $USERNAME Copy your script from previous procedure and rename it to reflect for this procedure. Modify it to display following output: Hello, my name is . My age is . My user name is

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students explore these related Databases questions