Re: What version of korn shell?

From: --==[bman]==-- (bmynars_at_verizon.net)
Date: 06/19/04


Date: Sat, 19 Jun 2004 05:02:24 GMT


--==[bman]==-- wrote:
> I am not sure what the problem is so maybe someone will help me out
> here. What version of Korn shell is factory installed on HP-UX systems
> (10.x, 11.x)? I am always running into a problem of a "subscript" being
> too large which is at 1024 which is a limitation of Korn 88 and before.
> I have tried calling my scripts with /usr/bin/ksh, /bin/sh (which is
> exhibits the same behavior as Korn) but always with the same results.
>
> I cannot create an array with more than 1024 elements (subscripts). No
> problem in Bash or pdksh.
>
> Any ideas?
>
> Thanks.
>

O.K. I will it my own words. pdksh on my SuSE 9.1 has the same
problem. Piece of code:

typeset -i i=0
while [ $i -lt 1025 ]; do
   myArry[(( i+=1 ))]=$i
done

This code will generate "pdksh: myArry: subscript out of range". The
same results will be on standard ksh shell on HPUX. I cannot believe
that I am limited to 1024 elements/subscripts in the array here!

-- 
     __    _
    / /   (_)___  __  ___  __
   / /   / / __ \/ / / / |/_/
  / /___/ / / / / /_/ />  <
/_____/_/_/ /_/\__,_/_/|_| is what you make of it.


Relevant Pages

  • Re: ksh on Linux and echo
    ... > I am using the Korn Shell that is avaible for Red Hat Enterprise Linux ... > This is not pdksh, as pdksh has some limitations that I cannot live ... > We do not want to change these scripts, ... Fix them. ...
    (comp.unix.shell)
  • Re: Help - How to auto start a command
    ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
    (linux.redhat.misc)
  • Re: Help - How to auto start a command
    ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
    (comp.os.linux.networking)
  • Re: Help - How to auto start a command
    ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
    (linux.redhat)
  • Re: Help - How to auto start a command
    ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
    (comp.os.linux.misc)