Shell Scripting

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ddeery13

Thread Starter
Joined
Nov 20, 2011
Messages
6
I need help writing a script called stats, which provides the user with useful information about the status of their system. The user should run this by typing stats at the command prompt. The output should be displayed immediately on stdout . Anyone able to help me?
 

ddeery13

Thread Starter
Joined
Nov 20, 2011
Messages
6
i also have another question -
Write a script called area which takes two numerical arguments representing the base length and height of a right-angled triangle, plus one or two options, -a, and –h meaning area and help.
Wiih option –a, the area of the triangle should be displayed on standard output preceded by the message ‘Area is: . With option –h, a short help message should be displayed. With no options there should be no output. Any other option should be ignored except that a warning ‘invalid option’ should be output.

for that one, i have the following so far -

echo –n “Enter base of a triangle : ”
read b
echo –n “Enter height of a triangle : ”
read h
area = $ (echo “scale=2; (1/2) * $b * $h |bc)
echo “Area of a triangle is $area”

how would i incorporate the - a and - h features?
 
Joined
Jul 16, 2008
Messages
19,165
As stated before, we don't assist with homework. It's strongly advised that you desist from posting any more of this kind.

Closing this.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top