Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Part-1

1. How can you perform a ?oating point comparison? You should include two examples, one in C-shell and one in Bourne shell.

2 Explain the getopts command and write a sample shell script that uses getopts.

Part-2 Bourne Shell

1. You should write the following questions in Bourne shell and design suitable functions for each of them.

-  Write an alarm clock script that sleeps for a number of seconds and then beeps and displays a message after that times has elapsed. The number of seconds is set based on an input argument.

- Use a recursive function to print each argument passed to the function, regardless of how many arguments are passed. You are allowed to echo only the ?rst positional argument (echo $1).

2. Write a Bourne shell script that create an HTML ?le. This ?le should have a table of 4 columns and n rows. The table's elements are the contents of a directory. Directory names are written in blue and ordinary ?le names are written in green.

The above command line creates an html ?le myhtml.html and this ?le is shown in ?gure 1.

3. Write a Bourne shell program that displays the following menu to the user:

Would you like to:

1. Look someone up

2. Add someone to the phone book

3. Remove someone form the phone book

4. Quit

Please select one of the above (1-4):

For option 3, if multiple entries are found, then the program will prompt the user for the entry to be removed:

More than one match, please select the one to remove:

AAA Brown Remove[y or n]: y

AAA Blue Remove[y or no]: n

Part-3 Bourne shell and C-Shell

You should write two scripts for each of the following questions: one in Bourne shell and one in C-Shell.

1 Write a program called isyes that returns an exit status of 0 if its argument is "yes" and 1 otherwise. For purpose of this exercise, consider y,yes, Yes, YES and Y to be valid "yes" arguments.

2 Write a program called counttime that prints the number of hours and minutes that a user has been logged on to the system (assume that this is less than 24 hours). The name of the user is an input argument.

3 Write a Shell script that checks the validity of a userid that is passed as an input argument. If the userid is available on mars it will display the appropriate message.

4 Write a shell script that looks at the name on on the command line and responds with the output string Web page if the name ends with html or with htm and with the output string applet if the name ends with class

5 Write a shell script that changes the permissions of all the ?les in the current directories that ends with scpt so that they are executable by everyone.

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

Suppose the cost function of making jackets is cx x2 -

Suppose the cost function of making jackets is C(x)= x^2 - 50x+1500. How many jackets should you make to minimize the cost of the jackets? How much would be the minimum cost?

Question suppose a computer using set associative cache has

Question : Suppose a computer using set associative cache has 2^16 words of main memory and a cache of 128 blocks, and each cache block contains 8 words. Show steps, please type. a. If this cache is 2-way set associative ...

A chemistry student needsnbsp700 ml of dimethyl sulfoxide

A chemistry student needs 70.0 mL of dimethyl sulfoxide for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of dimethyl sulfoxide is 1.10 g.cm^-3. Calculat ...

As noted in chapter 14 of aampa distribution of income

As noted in Chapter 14 of A&A, distribution of income among various population groups followed roughly the same patterns in the USA, Sweden, and the former Soviet Union, despite the very different forms of economic organ ...

Tasks1 what options does personal trainer have for

Tasks: 1. What options does Personal Trainer have for developing a new system? What are some specific issues and options that Susan should consider in making a decision? 2. Susan has been asked to prepare a system requir ...

You are evaluating two different silicon wafer milling

You are evaluating two different silicon wafer milling machines. The Techron I costs $255,000, has a three-year life, and has pretax operating costs of $68,000 per year. The Techron II costs $445,000, has a five-year lif ...

When we look at the ease to enter the different market

When we look at the ease to enter the different market structure, there is no doubt that 'monopoly' is the hardest. Why? -- There is only ONE firm that has established 'economies of scale' with the production of their go ...

You randomly sample 50 theaters in the united states you

You randomly sample 50 theaters in the United States. You ask those theaters how much they charge for a large popcorn, and you get a sample mean of $6. Then, you make confidence interval using this data with the lower li ...

Describe how to discover cookies on web browsers what is a

Describe how to discover cookies on web browsers. What is a reverse DNS lookup and can it be used when attacking the network.

Question individual project - submit to the unit 3 ip

Question: Individual Project - Submit to the Unit 3 IP Area This part of the assignment is FOR GRADING for this week. This assignment is a document addressing security and should be submitted to the week's individual dro ...

  • 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