On Tue, 23 May 2006, bob wrote:

> > Two comments.
> >
> > One: the output above didn't come from PDKsh in Cygwin (and, most
> > likely, didn't even come from the script you posted, since the export
> > statement is on line 9 in your script).  FYI, there is more than one
> > ksh implementation in Cygwin, and you'll need to tell us more about
> > your Cygwin installation (by following the Cygwin problem reporting
> > guidelines at <http://cygwin.com/problems.html>, especially the bit on
> > *attaching* the output of "cygcheck -svr").
> >
> > Two: PDKsh doesn't understand the "export a[*]" syntax.  It does
> > understand the "export a[1]" syntax, and even adds the array elements
> > to the export table, but there *is* a bug in it that doesn't actually
> > propagate the exported array elements to subshells.  I'll look into it
> > once I find the time.
> >
> > Igor Peshansky, volunteer PDKsh maintainer for Cygwin
>
> Igor
>
> Thanks much for responding.  My responses to your comments:
>
> Your right on the output... I cut out the stuff I tried but did not work
> in the program for clarity.

Would be nice to have the complete testcase, including the output...  Not
that the "export a[*]" syntax would work in it in any case...

> And 2 your are also right that it did not come from PDKsh.... I actually
> tried to envoke PDKsh by putting #!/bin/PDKsh on line 1 of test1 and
> test2 but all I got was an error msg (: bad interpreter: No such file or
> directory).

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 have come to realize that there is more than 1 implementation of ksh.
> 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 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_"

A variant of this solution will also allow "exporting" arrays in bash.
HTH,
        Igor
-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_            [EMAIL PROTECTED] | [EMAIL PROTECTED]
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/

Reply via email to