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
Solved

Adding non-numeric values in korn shell script

Posted on 2002-05-04
3
613 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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