This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: export arrays in cygwin ksh


On Tue, 23 May 2006, bob wrote:

> > The filenames may be case sensitive, too -- the executable is called
> > "pdksh.exe", not "PDKsh.exe".  However, if you had followed the Cygwin
> > problem reporting guidelines at <http://cygwin.com/problems.html>, we
> > would have known what packages you have installed on your system.
>
> I tried changing case but to no avail.  there is no pdksh file in my
> cygwin/bin directory so I think I am out of luck w/ pdksh.  I ran
> cygcheck as suggested in the url above.  Lots of good info.  not sure
> how to attach the file, but here is a partial listing (hopefully I
> captured what you are looking for!)

Umm, a partial cygcheck output, inline, is not particularly useful.  You
attach it as you would attach anything else to your email -- the exact
procedure depends on your email client (I'd open the help and search for
"attach").

>     Cygwin DLL version info:
>         DLL version: 1.3.12
>         DLL epoch: 19
>         DLL bad signal mask: 19005
>         DLL old termios: 5
>         DLL malloc env: 28
>         API major: 0
>         API minor: 54
>         Shared data: 3
>         DLL identifier: cygwin1
>         Mount registry: 2
>         Cygnus registry name: Cygnus Solutions
>         Cygwin registry name: Cygwin
>         Program options name: Program Options
>         Cygwin mount registry name: mounts v2
>         Cygdrive flags: cygdrive flags
>         Cygdrive prefix: cygdrive prefix
>         Cygdrive default prefix:
>         Build date: Sat Jul 6 02:16:58 EDT 2002
>         CVS tag: cygwin-1-3-12-1
>         Shared id: cygwin1S3

YOUCH!!!  That would be the first thing I would change about your
installation.  You are running with a 4(!)-year-old version of Cygwin.

> Cygwin Package Information
> [snip]
> pcre                3.7-1
> rcs                 5.7-3

> > > I have come to realize that there is more than 1 implementation of
> > > ksh.

Actually, I was mistaken -- there *is* only one official ksh
implementation in the current distribution.  Others have been proposed,
but, for one reason or another, did not make it in.

> > > The syntax I used in my example is exactly what I use on my hp
> > > unix workstation and it works fine on the hp.  I did try to export
> > > individual elements like you suggest with no luck.
> >
> > What does "ksh -c 'echo $KSH_VERSION'" print on your hpux workstation?
> > How about on Cygwin?  What is the output of "ls -l /bin/ksh.exe"?
>
> I get blank line for the 1st command, in both cygwin and hpux.

You are not using pdksh.

> for 2nd
> on cygwin:
> ls -l /bin/ksh.exe
> -rwxr-xr-x    1 ae5460t  Administ   502784 Aug  7  2002 /bin/ksh.exe

I don't know where you got this ksh, but it wasn't from an official Cygwin
installation.  Thus, I would recommend either finding out where your ksh
came from (and contacting that venue for support), or installing pdksh
(which is what I've been assuming you use, so the recipe below should
work).

> > > I did find in my installation in the cygwin/bin dir a file ksh.exe
> > > which is what I assume it was running.  Guess that is not pdksh.
> >
> > PDKsh installs a /bin/ksh symlink if none is present.  So it could be
> > pdksh.  Please follow the above directions so that we can find out.
> >
> > > My own IT people do not know what version of cygwin I am using (I am
> > > not laughing!)  I will try to find out more info on this.  I think
> > > we are using redhat, but will dig deeper.  Thanks
> >
> > Please read and follow the Cygwin problem reporting guidelines at
> > <http://cygwin.com/problems.html>.  That will tell us the version of
> > Cygwin and various packages in your installation.
> >
> > > Your last comment - are you saying I may not be able to export my
> > > array data to later processes or script files ?
> >
> > You may try the other ksh packages in Cygwin, and see if they address
> > your problem.  Otherwise, the portable solution would be something
> > like
> >
> > # In the parent script
> > for i_ in `seq 0 ${#vname[*]}`; do vname_="$vname_ '${vname[$i_]}'"; done
> >
> > # In the child script
> > eval "set -A vname $vname_"

Umm, ok, I forgot to do "export vname_" in the first line, but you must've
figured that out, since it worked for you...

> Tried the portable solution above ... slick solution, it gets the data
> into the child as a single variable.... only problem, in cygwin the -A
> is not available so I may have to brute force the array.  I get this
> error
>
> ./test2: line 1: set: -A: invalid option
> set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]

This sounds like the output from bash, actually...  I suspect your
/bin/ksh.exe is a copy of bash.exe, but your installation is too old for
me to try figuring out whether this is the case.  Just upgrade.

> Thanks for all the help again, and for your patience.

As I said, the version of ksh you have in Cygwin is not pdksh.  Switch to
pdksh, and the above solution will work.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]