Solved

Adding non-numeric values in korn shell script

Posted on 2002-05-04
3
616 Views
Last Modified: 2013-12-26
I want to add non-numeric values i korn shell script, how do I do it. expr doesn't work for non-numeric values.    
eg, $a=1.00 $b=2.00, how do I get $a+$b in shell scripts?
0
Comment
Question by:prasen120998
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 6989946
# not possible with ksh build-in commands, but try:
c=`echo $a $b|awk '{print $1+$2}'`
0
 

Author Comment

by:prasen120998
ID: 7001760
Is there any other way for different shell?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7002885
AFAIK no. Only intgers possible.
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question