- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Odd problem with "let"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 11:43 PM
02-09-2004 11:43 PM
I'm facing to the following problem in my last shell script:
Everybody knows that:
600426*4096=2459344896
...everybody but let...
#let MEM_FREE=600426*4096
#echo $MEM_FREE
-1835622400
Is there any limitation with let? (i.e. 2147483648 = 2Gb)
How can assign the correct value to MEM_FREE?
Thanks a lot for your help!
Simone
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 11:52 PM
02-09-2004 11:52 PM
Re: Odd problem with "let"
$ echo `expr 524287 * 4096`
2147479552
There is not a higher value possible. Don't know the cause. Maybe this number does anything to someone.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 11:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 11:54 PM
02-09-2004 11:54 PM
Re: Odd problem with "let"
For big numbers use bc in your script
You are hitting a known problem;
#!/usr/bin/sh
#You could use the 'two way pipe' to the program to do all your math operations,
like this:
# This starts bc with a two-way pipe
bc |&
# print -p writes to the pipe
print -p scale=4
print -p 3/4
# read -p reads from the pipe
read -p myvar
echo $myvar
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 11:57 PM
02-09-2004 11:57 PM
Re: Odd problem with "let"
check this link: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=19128
There is indeed a limitation.
The link also contains suggestions.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2004 12:02 AM
02-10-2004 12:02 AM
Re: Odd problem with "let"
I'll use "bc" in my scripts.
Points assigned...
Simone