![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Absolute value | placroix1 | Shell Programming and Scripting | 5 | 12-04-2007 07:26 AM |
| absolute path | Kirichiko | UNIX for Dummies Questions & Answers | 2 | 10-03-2007 07:30 AM |
| get absolute filename | mainegate | Shell Programming and Scripting | 0 | 08-21-2007 01:59 PM |
| absolute path | filedeliver | High Level Programming | 4 | 06-05-2007 06:18 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Getting absolute value ksh
Hi,
I am trying to find out how to get an absolute value for integer in ksh. I tried using abs... but that doesn't work ! this is the workaround I did, but isn't there an inbuilt function to get absolute value for any variable ! Please help as i am new to unix Thanks, ********************************** #!/usr/bin/ksh ACTROWCNT=100 EXPROWCNT=100 if [ ${ACTROWCNT} -ge ${EXPROWCNT} ]; then diff=`expr ${ACTROWCNT} - ${EXPROWCNT}` else diff=`expr ${EXPROWCNT} - ${ACTROWCNT}` fi if [ ${diff} -gt 100 ]; then echo "should fail" else echo "Continue" fi exit 0 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|