- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script syntax checking
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
10-25-2001 04:51 AM
10-25-2001 04:51 AM
# cat script
typeset idx=0
HP_DSK[$idx]="hello"
TOTO=${HP_DSK[$idx]}
it returns nothing (meaning it's OK) under HP-UX 10.20.
But under HP-UX 11.X, I get the following error message :
script[3]: HP_DSK: The specified subscript cannot be greater than 1024
Is this a regression (a bug) ? or does it perform a more complete check (and so, where is my error) ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 05:05 AM
10-25-2001 05:05 AM
Re: script syntax checking
That is simply a warning that any array index cannot exceed 1023. The -n does not actually evaluate the expression $idx; it's just telling you that you may have problems.
Set the value idx to 1024 and actually execute
you script. You will then get a real 'honest-to-God' run-rime index error.
It appears that the warnings are simply a little better in 11x. Both OS versions will actually fail at run-time.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 05:14 AM
10-25-2001 05:14 AM
Re: script syntax checking
Return code is 1 and not 0.
And, most important, it stops further checking.
I intentionally added an error on a 4th line.
Under 10.20, I get an error on line 4.
Under 11.X, It still stops with the same message about line 3 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 05:35 AM
10-25-2001 05:35 AM
SolutionA couple of comments. First the "normal" behavior of using '-n' is to stop on the first error. Therefore, in your 10.20 vs. 11.0 case you are *still* seeing the 11.0 behavior of the subscript limit checking.
Most importantly, though, it looks to me too like this is a *bug*, since cases like your snippet of shell could not be debugged with the -n' option.
I don't find this problem on 11.0 with the Korn (ksh) shell, only the Posix one.
Also, to get real picky, the error message is poorly written -- subscripts range from 0-1023 which is 1024 elements, but... ;-)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 05:47 AM
10-25-2001 05:47 AM
Re: script syntax checking
Seems to be a bug.
ksh does not give the problem
even in 11.00 .
-R