Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unix Scripting Each of these scripts are separate and unrelated. Please write each of these scripts in: a.) Bourne Shell, b.) C-Shell, c.) Korn Shell,

Unix Scripting Each of these scripts are separate and unrelated. Please write each of these scripts in: a.) Bourne Shell, b.) C-Shell, c.) Korn Shell, and d.) Z Shell.

5. Write a script that uses a switch or case statement (depending on shell) to do the following. First ask the user for a color. If they enter anything that begins with bl or Bl, then print the sky color is (whatever the user entered). If the user enters red or yellow, the print the sun is sometimes this color. If the user enters any other color, then enter that the color is not in any of the categories defined.

6. Write a simple while loop which prints out numbers from 0 through 9 using the @ operator and a variable. In case of Bourne shell, use the expr command to increment the loop variable.

7. Write a script called days which is run as follows from the command line: days Monday Tuesday Wednesday Thursday Friday Saturday Sunday and it prints out the days in the following way: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Tuesday Wednesday Thursday Friday Saturday Sunday Wednesday Thursday Friday Saturday Sunday Thursday Friday Saturday Sunday Friday Saturday Sunday Saturday Sunday Sunday

8. Write a script that takes in two arguments that are positive integers. The script should figure out which of the two integers is smaller and should use that to figure out the greatest common divisor (GCD) of the two integers and print it out. Also, figure out the lowest common multiple (LCM) of the two integers and print it out.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions