[HPADM] RE: Getting an absolute value



Getting an absolute value is pretty simple

# echo $a | tr -d -
or
# echo $a | sed 's/-//'

Best regards,
Kees Couprie

-- Save the earth. It's the only planet with chocolate.


-----Original Message-----
From: hpux-admin-owner@xxxxxxxxxxxxx
[mailto:hpux-admin-owner@xxxxxxxxxxxxx] On Behalf Of Shaw, Marco
Sent: Thursday, October 12, 2006 16:38
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] Getting an absolute value

Can't believe google doesn't provide an answer, searched these
archives also!

#a=`expr 2 - 1`
#echo $a
1
#a=`expr 2 - 3`
#echo $a
-1

I want to get the absolute value of the difference. I don't
have to use expr, but also would prefer something available
directly with the Borne shell.

Marco

--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact
majordomo@xxxxxxxxxxxxx
Name: hpux-admin@xxxxxxxxxxxxx Owner:
owner-hpux-admin@xxxxxxxxxxxxx

Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin
(FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web,
browse & search)


Attachment: smime.p7s
Description: S/MIME cryptographic signature



Relevant Pages

  • Re: Time dilation
    ... There is no absolute frame. ... Time runs at maximum speed at Absolute rest frame. ... Absolute time of the free space ... Time inside a planet runs linearly increasing towards the ...
    (sci.physics.relativity)
  • Toward a Rational Definition of what is a Planet
    ... As I have already mentioned in the "mini planet" thread, ... What I am less confident about is the arbitrariness of the definition. ... define the appropriate sphericalness of a planet in quantitative terms. ... absolute magnitude, based on our assumptions of what their albedo might ...
    (sci.astro)
  • Re: Toward a Rational Definition of what is a Planet
    ... > phrase "Planet X is really big" is not testable, ... > What I am less confident about is the arbitrariness of the definition. ... > define the appropriate sphericalness of a planet in quantitative terms. ... > absolute magnitude, based on our assumptions of what their albedo might ...
    (sci.astro)
  • Re: OT:Way to go Al
    ... "Man is contributing to global warming" is, IMO, fear-mongering that ... this planet is a tiny blip. ... Nobody said we need Al Gore to protect us. ... they put absolute, total blind faith into anybody that will allow them to ...
    (alt.smokers.cigars)
  • Re: Yagi efficiency
    ... 0.001% by this criterion. ... If absolutely EVERYONE (presuming 6 billion of us) on the planet got ... practicable purposes indistinguishable from absolute Zero. ...
    (rec.radio.amateur.antenna)