Explore BrainMass
Share

Shell scripting: Few parameter expansion related questions

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Give brief answers for the following questions.

1. Can an until loop sometimes never execute?

2. Will the following script execute with no errors?

#!/bin/csh
for I
do
echo $I
done

3. Does the following script print to standard output, a list of numbers equal to the number passed on the command line?

#!/bin/sh

count=$1

index=1
while [ "0$index" -le $count ]
do
echo $index
index=`expr "$index" + 1`
done

4. Will the following statement print 'I am glad this class is over' to standard output if the shell variable XYZ is NULL or not set?

: ${XYZ:?"I am glad this class is over"}

5. After the statement

: ${VISUAL:=vi}

will the value of the shell variable VISUAL always be vi?

6. Will the following command execute:

${VISUAL:+vi} ls

the command 'ls' if the shell variable VISUAL is not set or null?

7. Will the following commands send to the line printer all files whose contents contain the text '/bin/sh' if the command to print is lpr ?

MATCH=`grep -l '/bin/sh' *`
lpr ${MATCH?"NO files found"}

© BrainMass Inc. brainmass.com October 24, 2018, 10:14 pm ad1c9bdddf
https://brainmass.com/computer-science/files/shell-scripting-few-parameter-expansion-related-questions-152465

Solution Preview

1. Yes, sometimes an until loop will never execute. Consider the example given below.

#!/bin/bash
myvar=5
until [ $myvar ...

Solution Summary

Solution also gives reasons/examples in many cases.

$2.19
See Also This Related BrainMass Solution

Business Cases: AOL and Time Warner; The Ax Falls on Sunbeam's Chainsaw Al; Harley-Davidson

The following case study questions are based on the reading about the mentioned companies and taking conclusions based on the reading of the textbook: Bovee, C.L., Thill, J.V. & Mescon, M.H. (2005). Excellence in Business, Revised Edition. New Jersey. Prentice Hall.

Alternatively, I guess one has the possibility to answer these questions by reading on the companies' cases.

AOL and Time Warner: Fragile Promises
(Pages 161-162). QUESTIONS:
? Why did the media refer to the merger as the deal of the century?
? Why was Time Warner eager to merge with AOL?
? What challenges did AOL and Time Warner face as a merged company?.
? Visit the Time-Warner Website (http://www.timewarner.com). Review the site to get the latest news about the fate of the merger. How is the company doing financially? How much turnover has occurred among high-level executives? If any parts of the business have been sold off, what has the acquiring company said about future prospects?

The Ax Falls on Sunbeam's Chainsaw Al.
(Pages 187-188). QUESTIONS:
? Why were Dunlap's goals unrealistic for Sunbeam?
? Was Dunlap's slice-and-dice plan a long-term or short-term strategy. Please explain.
? Why did Dunlap's turnaround strategy backfire?

Harley-Davidson-From Dysfunctional to Cross-Functional.
(Pages 212-213). QUESTIONS:
? During Teerlink's tenure as Harley's Chief Financial Officer, was the
organization structure flat or tall? Centralized or decentralized?
Explain your answers.
? As Chief Executive Officer, how did Teerlink change the organizational structure?
? Why does Harley-Davidson include outside suppliers on its cross-functional teams?

--------------------

I am looking for help with the questions. I want as much information as possible on each case e.g, articles, newspaper clips, etc.

Thank you for this assistance.

View Full Posting Details