Don't bother with csh.
Main Topics
Browse All TopicsHow to write a script using c shell to convert cm to inches?
formula: cmx0.39 ---> inches
The thing is C shell can't do floating point mathematics :((((
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Just note that this solution doesn't "use" C shell any more than just using any external program manually on the shell. It just takes the input from another external program, "bc" in this case, which is not C shell specific in any way, but just a general purpose calculator.
If that's good enough for you, you could just have taken "units" in the first place, which would have had the advantage that it already has all the conversion factors already built in.
Business Accounts
Answer for Membership
by: wilhelm_voigtPosted on 2008-09-07 at 14:13:14ID: 22412913
why re-invent the wheel? there's a handy little tool called "units" which could do this for you.
try e. g.
units "0.39 cm" "inches"
(maybe you'll have to install it first on your distribution, search for "units" in your distribution's package manager)