[HPADM] RE: Getting an absolute value
- From: "COUPRIE Kees" <Kees.COUPRIE@xxxxxxxxx>
- Date: Fri, 13 Oct 2006 11:15:48 +0200
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
- References:
- [HPADM] Getting an absolute value
- From: Shaw, Marco
- [HPADM] Getting an absolute value
- Prev by Date: [HPADM] Data Protector pa-risc 11.11 to itanium 11.23
- Next by Date: [HPADM] [SUMMARY] Data Protector pa-risc 11.11 to itanium 11.23
- Previous by thread: [HPADM] Getting an absolute value
- Next by thread: [HPADM] RE: Getting an absolute value
- Index(es):
Relevant Pages
|