Suppose the script ran under the bourne shell

Assignment Help Computer Engineering
Reference no: EM1336595

1. Will the following only print the text "I FOUND A MATCH" to standard output when the grep is successful?

if grep "mrichard" /etc/passwd; then echo "I FOUND A MATCH"; fi

2. Does the following command send both standard output and standard error to the same file for the command cmd1?

cmd1 2>&1 >outfile

3. Does cmd2 receive both the standard error and standard output of cmd1 as standard input?

cmd1 2>&1 | cmd2

4. Will the script below always print out the text 'They are the same' assuming the script ran under the Bourne shell?

#!/bin/sh
infile=${0}

if [ ! -s "$infile" ]
then
exit 1
fi

linecnt=`wc -l $infile | while read cnt rest
do
echo $cnt
done`

mycnt=0
while read line
do
mycnt=`expr $mycnt + 1`
done < $infile

if [ $linecnt -eq $mycnt ]
then
echo They are the same
else
echo They are different.
fi

5. Does the standard output of this script get sent to STDOUT?

#!/bin/sh

exec 4>&1
exec 1>&2
exec 2>&4
exec 4>&-
echo Hello
echo More text

6. Is the visible output of this script, the text 'Hello'?

#!/bin/sh

(
exec 4>&2
exec 2>&1
exec 1>&4
exec 4>&-
echo Hello
) 2> /dev/null

Reference no: EM1336595

Questions Cloud

Forecast the next period using simple exponential smoothing : Calculate the forecast for the next period using simple exponential smoothing.
Could an until loop sometimes never execute : could an until loop sometimes never execute.
Utlizing the aggregate demand and aggregate supply : Utlizing the aggregate demand and aggregate supply model, draw an economy in a boom.
Concept of victim precipitation supported by evidence : Why is the concept of victim precipitation so controversial? Do you feel the concept is adequately supported by evidence?
Suppose the script ran under the bourne shell : suppose the script ran under the Bourne shell.
Explain marketing mix impact the marketing strategy : Explain Marketing mix and explain how the elements (product, place, price, and promotion) of the marketing mix impact the development of the organization's marketing strategy and tactics
Find out the marketplace value of output and household : Find out the marketplace value of output and household saving. What is the relationship of saving and investment.
Determine productivity : Calculate the productivity of the plant.
Make a basic web page using html tags : build a basic Web page using HTML tags. The page should present information about a company/organization or about a profession.Please include all Web site files.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What would be the last statement executed

define the output of the screen when the program executes with a value of 200.

  How to modify the temperature conversion program

Add two buttons to temperature conversion program. Clicking one button converts Fahrenheit to Celsius, clicking the other converts Celsius to Fahrenheit. It will help the user to have a "clear" button that clears  text in both text fields.

  How will you explain how arrays are used

If you were explaining an array ti a friend who is learning Java. how will you do so?

  What are the latest advancements in cabling

Why would a company want a network on its premises? How will a department or company benefit by having a network.

  What is dft of a pure cosine wave cos

What is DFT of a pure cosine wave cos(t) sampled at n equally spaced points on the interval [0, 2π)?

  How to calculate the area of a circle

Develop a software application to calculate the area of a circle. The application must accept only one value (radius) and it must display the result in decimal value.

  Describe two companies with a global presence

I want to construct a PowerPoint Presentation identifying, comparing, and contrasting the IT governance structure for two major companies with a global presence.

  Plan an algorithm that prompts

Design an algorithm that prompts the user to enter a secret word. The secret word must be at least 8 characters long. Validate the input.

  More detail to be shown as a process is exploded

In data flow diagrams (DFDs), a process symbol can be referred to as a black box, becase the inputs, outputs, and general funcions of the process are known, but the underlying details and logic of the system are hidden.

  Suppose a station ti takes 2 hours to change horses

suppose that at a station ti takes 2 hours to change horses and a horse takes (x ln x)/100 hours to travel x miles. plan a dynamic programming algorithm to determine a sequence of stations at which to stop so as to minimize the total hours.

  Health care services

Compare and contrast the cost-effectiveness, benefit-cost, and cost-utility analysis and find which is most useful to assess value of the health care services overall.

  What represent the length and width of a room in feet

build a Java class that declares variables to represent the length and width of a room in feet. Assign appropriate values to the variables. calculate and display the floor spae of th eroom in square feet (area = length * width). Display explnatory ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd