Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Q1) Step 1: Create a script named it config as follow: VAR1=foo VAR2=bar Create a script named it test as follow: #!/usr/bin/env bash

Create a

Q1) Step 1: Create a script named it "config" as follow: VAR1="foo" VAR2="bar"

Create a script named it "test" as follow:

#!/usr/bin/env bash . config echo "VAR1 is $VAR1" echo "VAR2 is $VAR2"

Run the "test" script. Explain the output (attach the screenshot)

What is the role of "."?

What If you removed the "." in the 2nd line (just keep the "config" in that line). Is there any changes in the output?

Q2)

Give a command without using a loop which defines and initializes a set of variables. The variable names have the following format:

"myvar_(pos1)_(pos2)"

where (pos1) is between "a" and "d", and (pos2) is between 1 and 4.

Initialize all variables to zero at the momoment that they are defined. Here are a few variable examples generated by the command.

myvar_a_1=0

myvar_a_2=0

...

myvar_b_1=0

myvar_b_2=0

...

myvar_d_4=0

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

Step: 3

blur-text-image

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

Computer Networks

Authors: Andrew S. Tanenbaum, David J. Wetherall

5th edition

132126958, 978-0132126953

More Books

Students also viewed these Computer Network questions

Question

Have you presented the facts correctly?

Answered: 1 week ago

Question

LO1.4 Explain the FAIR approach to ethical business communications.

Answered: 1 week ago