Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) For each of these exercises, write down which command you issued, and record the output that it generated. Answer any questions posed in the

1) For each of these exercises, write down which command you issued, and record the output that it generated. Answer any questions posed in the assignment concisely, but correctly.

( a ) Write a shell script that welcomes you by name and tells you good morning (6am-noon), good afternoon (noon-6pm), good evening (6pm-midnight), or good night (midnight-6am).

Sample run:

$ ./hello.sh Good evening, John Doe. 

Hint: read up on the date command and the cut command and take a look at the file /etc/passwd. Your login name is returned by the whoami command and/or by the USER environment variable.

( b ) Expand the program that you write in (2) so that it fetches the most current weather reports for KJFK (JFK Airport), KLGA (LaGuardia Airport), and KISP (Long Island McArthur). Also make it print the current temperature, measured in Fahrenheit.

Sample run:

$ ./helloTemp.sh Good evening, John Doe The current temperature at KJFK is 55 F The current temperature at KLGA is 60 F The current temperature at KISP is 53 F 

Hint: use the metar command to obtain a weather report. To convert Celsius to Fahrenheit, use the formula fahrenheit = celsius * 9 / 5 + 32

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: 3

blur-text-image

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago

Question

=+ Are there additional forms of employee representation?

Answered: 1 week ago

Question

=+What is the nature of their impact?

Answered: 1 week ago

Question

=+Is it possible to operate union-free?

Answered: 1 week ago