Question: 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
Get step-by-step solutions from verified subject matter experts
