The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Environment variable MasterapocA SUN Solaris 2 03-18-2008 09:39 AM
sed on an environment variable ? lumix Shell Programming and Scripting 3 12-15-2007 06:30 PM
What is the Maximum number of characters that i can store in a variable? pcshan UNIX for Advanced & Expert Users 9 08-11-2004 06:25 PM
TOR environment variable Wittich UNIX for Dummies Questions & Answers 3 07-30-2003 01:40 PM
Environment Variable jacobsa UNIX for Dummies Questions & Answers 8 06-03-2002 04:02 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-14-2005
tonyv tonyv is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 2
Environment variable maximum value

I am trying to write a script which tests for space on a file system and then uncompresses a backup if enough space is available. However the script has failed because I seem to have hit an upper limit for the value of an integer variable.

It can be demonstrated with this piece of code:

#!/bin/ksh
typeset -i x=5452603392
typeset -i y=13967597568

if [ $x -le $y ]
then
echo true
else
echo false
fi


This returns false. Can anybody advise of another way of doing very large integer comparisons?

Thanks
  #2 (permalink)  
Old 03-14-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
The technique I mention in this thread will also work for very large integers.
  #3 (permalink)  
Old 03-15-2005
tonyv tonyv is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 2
Thanks

Thanks Perderabo that's solved it.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0