Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9211963

Have any Question?


Related Questions in Computer Engineering

Find example that shows ideas can have big consequences in

Find example that shows ideas can have big consequences in the world. Describe the problem and how the idea helped to solve the problem. Include references

Customers for a restaurant arrive at an average rate of 36

Customers for a restaurant arrive at an average rate of 36 customers per hour during lunchtime. a. Write the Poisson probability distribution function with the specific parameters for this problem. b. Rewrite the probabi ...

Suppose we are given a directed graph ga we want to find 3

Suppose we are given a directed graph G; a) We want to find 3 edge disjoint paths from a designated starting vertex u to a specific destination vertex d (or determine that no such paths exist). Describe an efficient algo ...

Solve in visual basic 2015 - into to programming using

Solve in Visual Basic 2015 - Into to Programming Using Visual Basic Chapter 3.3 Exercise 88 - this is all the information in the question Marketing Terms // The markup of an item is the difference between its selling pri ...

Discuss the importance of metadata and some of the various

Discuss the importance of metadata and some of the various ways (Microsoft) SQL Server allows you to expose that information. References welcomed to learn where to find obscure IT information (books, articles, websites)

Question answer both question with minimum 150 words each

Question: Answer both question with minimum 150 words each. Provide examples and references. 1. Data Anomalies - Explain in your own words using tables from your lab project. Also describe how such anomalies could be pre ...

Question suppose that the tuition for a university is 10000

Question : Suppose that the tuition for a university is $10,000 this year and increases 5% every year. In one year, the tuition will be $10, 500. Write a program that displays the tuition in ten years and the total cost ...

Question part 1 capstone exam - submit to the unit 2 ip

Question: Part 1: Capstone Exam - Submit to the Unit 2 IP Area This exam assignment may only be completed through the end of Unit 4. It will not be accepted late during Unit 5. This exam may only be completed on a comput ...

On june 23 2016 the brits voted to exit the eu the

On June 23, 2016, the Brits voted to exit the EU. The following were the daily values of an investment. June 23 24 Dollars 109.60 111.60 If returns were to accumulate at the same rate over an entire year (252 trading day ...

From a security standpoint do you believe the apple

From a security standpoint, do you believe the Apple approach of hiding permissions or the Android approach of requiring the user to accept application permissions is a better approach? Why do you feel this way and do yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As