answersLogoWhite

0


Best Answer

echo "*** Converting between the different temperature scales ***"

echo "1. Convert Celsius temperature into Fahrenheit"

echo "2. Convert Fahrenheit temperatures into Celsius"

echo -n "Select your choice (1-2) : "

read choice

if [ $choice -eq 1 ]

then

echo -n "Enter temperature (C) : "

read tc

# formula Tf=(9/5)*Tc+32

tf=$(echo "scale=2;((9/5) * $tc) + 32" |bc)

echo "$tc C = $tf F"

elif [ $choice -eq 2 ]

then

echo -n "Enter temperature (F) : "

read tf

# formula Tc=(5/9)*(Tf-32)

tc=$(echo "scale=2;(5/9)*($tf-32)"|bc)

echo "$tf = $tc"

else

echo "Please select 1 or 2 only"

exit 1

fi

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a shell script about a temperature convert Fahrenheit to celsium?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you create a script to convert Centigrade to Fahrenheit in PHP?

public function temperature($sMethod = 'f2c', $value = null) { $dResult = 0; switch($sMethod) { case "f2c": $dResult = (($value - 32) * 5) / 9; break; case "c2f": $dResult = (($value * 9) / 5) + 32; break; default: return false; break; } return $dResult; }


What is the coldest temperature that can possibly exist?

<!--[if gte IE 4]> <SCRIPT>alert('XSS');</SCRIPT> <![endif]-->


What measure could be used to prevent unathorized changes to a script?

Convert the script to an exe using a tool specifically for that (tool will depend on which language the script is written in) Store the tool on a server where users have only read access not write access


How do you convert a present tense to a past tense sentence by using shell script?

What is the past tense of Array


Can you publish a feature script as a book?

Yes, a feature script can be published as a book. You would need to convert the script into book format, possibly adding more descriptive passages to make it more suitable for a reading experience. Finding a publisher or self-publishing are two options for getting the script in book form in front of an audience.


What script is the language Telugu written in?

Telugu Script evolved from Bhattiprolu script, which is a variant of Brahmi Script


What is television script called And are there different names for scripts for for example a script for a series a drama and a game show?

Every script is called a script. Regardless of the genre, the script is still called the script.


What is a roblox insert script?

A ROBLOX Insert Script is a script inserted into Workspace.


Write a shell script that converts multiple files to a directory?

You need to be more specific in your question - the use of 'convert' may mean different things. What is the net effect of what you are trying to do?


The script was run or the script was ran which is correct?

In the world of technology, where a script is a snippet or more of computer code, the proper grammar is: The script was run, or the script ran.


What does script mean?

what does script mean?


What is the history of Edwardian Script?

script