- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script bug?
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
01-17-2003 01:02 PM
01-17-2003 01:02 PM
STARTHOUR=6
ENDHOUR=15
hour=08
while (( $hour >= $STARTHOUR && $hour < $ENDHOUR ))
do
echo "running while number 1"
done
The weird part is that it fails when hour = 08 or 09. 01-07 or 10+ works fine. I don't like blaming patches for script errors but it's an awful coincidence.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 01:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 01:15 PM
01-17-2003 01:15 PM
Re: script bug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 01:28 PM
01-17-2003 01:28 PM
Re: script bug?
The strtol (string to long) function, if given a zero base argument, works like this:
If it sees a leading '0' then the value is interpreted as octal, if it sees a leading 0x or 0X, the value is intepreted as hexadecimal. Otherwise the value is decimal.
Man strtol for details.
I've seen this 'problem' occur between diffrent platforms and flavors of UNIX and when patches are appiled. The disciplined shell programmer will assume this behavior if any variables might have leading zeroes and typeset the variables to avoid this. This is one of those cases when you understand the underlying C, it's easier to understand what's going on.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 01:40 PM
01-17-2003 01:40 PM
Re: script bug?
PHCO_26789
You were correct though. From the script text:
The shell now recognizes octal and hexadecimal numbers inside arithmetic expressions. This may impact the behavior of certain scripts.