X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: bob Subject: Re: export arrays in cygwin ksh Date: Tue, 23 May 2006 20:07:09 +0000 (UTC) Lines: 331 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > 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 , 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!) Cygwin Win95/NT Configuration Diagnostics Current System Time: Tue May 23 14:42:20 2006 Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 4 ... HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin (default) = `' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 (default) = 0x0000002a cygdrive prefix = `/cygdrive' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/ (default) = 0x0000000a native = `C:\Apps\cygwin' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/afs (default) = `Y:' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/annex (default) = `D:\annex' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/apps (default) = `C:\apps' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c (default) = 0x0000000a native = `c:' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/d (default) = 0x0000000a native = `d:' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/home (default) = 0x0000000a native = `D:\Users' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/tmp (default) = 0x0000000a native = `C:\Tmp' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/users (default) = `D:\Users' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = 0x0000000a native = `C:\Apps\cygwin\bin' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = 0x0000000a native = `C:\Apps\cygwin\lib' HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options (default) = `' a: fd N/A N/A c: hd NTFS 30733Mb 22% CP CS UN PA FC System d: hd NTFS 63224Mb 75% CP CS UN PA FC Data e: cd N/A N/A f: net NTFS 207132Mb 87% CP CS UN PA FC EMC Dynamic g: net NTFS 207132Mb 87% CP CS UN PA FC EMC Dynamic h: net NTFS 311283Mb 91% CP CS UN PA FC Data i: net NTFS 276176Mb 86% CP CS UN PA FC DATA j: net NTFS 146788Mb 99% CP UN PA 1481 k: net NTFS 279984Mb 33% CP CS UN PA FC Data l: net NTFS 279984Mb 33% CP CS UN PA FC Data m: net NTFS 207132Mb 87% CP CS UN PA FC EMC Dynamic n: net NTFS 311283Mb 91% CP CS UN PA FC Data o: net NTFS 28137Mb 4% CP CS UN PA FC Data p: net NTFS 172609Mb 100% CP CS UN PA FC DATA q: net NTFS 55796Mb 57% CP CS UN PA FC Data r: net NTFS 63224Mb 75% CP CS UN PA FC Data s: net NTFS 345221Mb 77% CP CS UN PA FC DATA t: hd NTFS 152625Mb 42% CP CS UN PA FC IOMEGA_HDD u: net NTFS 345221Mb 77% CP CS UN PA FC DATA v: net AFS 2097151Mb 51% CP CS AFS y: net AFS 2097151Mb 51% CP CS AFS C:\Apps\cygwin / system binmode Y: /afs system binmode D:\annex /annex system binmode C:\apps /apps system binmode c: /c system binmode d: /d system binmode D:\Users /home system binmode C:\Tmp /tmp system binmode D:\Users /users system binmode C:\Apps\cygwin\bin /usr/bin system binmode C:\Apps\cygwin\lib /usr/lib system binmode . /cygdrive user binmode,cygdrive Found: C:\Apps\cygwin\bin\bash.exe Found: C:\Apps\cygwin\bin\cat.exe Found: c:\Program Files\Hummingbird\Connectivity\9.00\NFSClient\cat.exe Warning: C:\Apps\cygwin\bin\cat.exe hides c:\Program Files\Hummingbird\Connectivity\9.00\NFSClient\cat.exe Not Found: cpp (good!) Found: C:\Apps\cygwin\bin\find.exe Not Found: gcc Not Found: gdb Found: C:\Apps\cygwin\bin\ld.exe Found: C:\Apps\cygwin\bin\ls.exe Found: c:\Program Files\Hummingbird\Connectivity\9.00\NFSClient\ls.exe Warning: C:\Apps\cygwin\bin\ls.exe hides c:\Program Files\Hummingbird\Connectivity\9.00\NFSClient\ls.exe Found: C:\Apps\cygwin\bin\make.exe Found: C:\Apps\cygwin\bin\sh.exe 56k 2000/12/03 C:\Apps\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0 "cygbz21.0.dll" v0.0 ts=2000/11/20 18:53 625k 2002/08/10 C:\Apps\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0 "cygcrypto.dll" v0.0 ts=2002/8/9 16:20 45k 2001/04/25 C:\Apps\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0 "cygform5.dll" v0.0 ts=2001/4/25 1:28 35k 2002/01/09 C:\Apps\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0 "cygform6.dll" v0.0 ts=2002/1/9 1:03 19k 2002/02/20 C:\Apps\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0 "cyggdbm.dll" v0.0 ts=2002/2/19 22:05 17k 2001/06/28 C:\Apps\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0 "cyghistory4.dll" v0.0 ts=2001/1/6 23:34 20k 2002/07/18 C:\Apps\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0 "cyghistory5.dll" v0.0 ts=2002/7/17 17:18 929k 2002/06/24 C:\Apps\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0 "cygiconv-2.dll" v0.0 ts=2002/6/24 14:24 22k 2001/12/13 C:\Apps\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0 "cygintl-1.dll" v0.0 ts=2001/12/13 4:28 23k 2002/06/24 C:\Apps\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0 "cygintl-2.dll" v0.0 ts=2002/6/24 0:54 21k 2001/06/20 C:\Apps\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0 "cygintl.dll" v0.0 ts=2001/6/20 13:09 45k 2002/02/08 C:\Apps\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0 "cygjbig1.dll" v0.0 ts=2002/2/7 18:59 119k 2002/02/09 C:\Apps\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0 "cygjpeg6b.dll" v0.0 ts=2002/2/9 0:19 26k 2001/04/25 C:\Apps\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0 "cygmenu5.dll" v0.0 ts=2001/4/25 1:27 20k 2002/01/09 C:\Apps\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0 "cygmenu6.dll" v0.0 ts=2002/1/9 1:03 156k 2001/04/25 C:\Apps\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses++5.dll" v0.0 ts=2001/4/25 1:29 175k 2002/01/09 C:\Apps\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0 "cygncurses++6.dll" v0.0 ts=2002/1/9 1:03 226k 2001/04/25 C:\Apps\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses5.dll" v0.0 ts=2001/4/25 1:17 202k 2002/01/09 C:\Apps\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0 "cygncurses6.dll" v0.0 ts=2002/1/9 1:03 15k 2001/04/25 C:\Apps\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0 "cygpanel5.dll" v0.0 ts=2001/4/25 1:27 12k 2002/01/09 C:\Apps\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0 "cygpanel6.dll" v0.0 ts=2002/1/9 1:03 40k 2001/11/22 C:\Apps\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0 "cygpcre.dll" v0.0 ts=2001/11/21 17:15 39k 2001/11/22 C:\Apps\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0 "cygpcreposix.dll" v0.0 ts=2001/11/21 17:15 179k 2002/07/22 C:\Apps\cygwin\bin\cygpng12.dll - os=4.0 img=1.0 sys=4.0 "cygpng12.dll" v0.0 ts=2002/7/22 12:03 22k 2002/06/09 C:\Apps\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0 "cygpopt-0.dll" v0.0 ts=2002/6/9 1:45 108k 2001/06/28 C:\Apps\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0 "cygreadline4.dll" v0.0 ts=2001/1/6 23:34 127k 2002/07/18 C:\Apps\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0 "cygreadline5.dll" v0.0 ts=2002/7/17 17:18 159k 2002/08/10 C:\Apps\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0 "cygssl.dll" v0.0 ts=2002/8/9 16:20 390k 2001/01/18 C:\Apps\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0 "cygtcl80.dll" v0.0 ts=2001/1/17 23:44 5k 2001/01/18 C:\Apps\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0 10k 2001/01/18 C:\Apps\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0 "cygtclreg80.dll" v0.0 ts=2001/1/17 23:44 253k 2002/02/10 C:\Apps\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0 "cygtiff3.dll" v0.0 ts=2002/2/10 3:34 41k 2002/01/20 C:\Apps\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-noX4.dll" v0.0 ts=2002/1/20 13:49 46k 2002/01/20 C:\Apps\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-X4.dll" v0.0 ts=2002/1/20 13:50 50k 2002/03/12 C:\Apps\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0 "cygz.dll" v0.0 ts=2002/3/11 23:38 883k 2002/07/06 C:\Apps\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2002/7/6 2:16 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 Cygwin Package Information Last downloaded files to: @ Last downloaded files from: @ Package Version _update-info-dir 00059-1 ash 20020731-1 bash 2.05b-3 clear 1.0-1 cpio 2.4.2 cron 3.0.1-7 cvs 1.11.0-1 cygrunsrv 0.95-1 cygutils 1.1.2-1 cygwin 1.3.12-4 cygwin-doc 1.1-2 diff 1.0-1 diffutils 2.8.1-1 ed 0.2-1 fileutils 4.1-1 findutils 4.1.7-4 gawk 3.1.1-2 gdbm 1.8.0-4 gnupg 1.0.7-3 grep 2.5-1 groff 1.17.2-1 gzip 1.3.3-4 jbigkit 1.2-6 jpeg 6b-7 less 374-1 libiconv2 1.8-2 libintl1 0.10.40-1 libintl2 0.11.2-2 libncurses5 5.2-1 libncurses6 5.2-8 libpng 1.2.4-2 libpng12 1.2.4-2 libpopt0 1.6.4-4 libreadline4 4.1-2 libreadline5 4.3-1 login 1.4-4 make 3.79.1-7 man 1.5g-2 ncurses 5.2-8 newlib-man 20020801 openssh 3.4p1-5 openssl 0.9.6g-1 pcre 3.7-1 rcs 5.7-3 readline 4.3-1 sed 3.02-1 sh-utils 2.0-2 shutdown 1.2-2 tar 1.13.19-1 termcap 20020403-1 terminfo 5.2-3 texinfo 4.2-3 textutils 2.0.21-1 tiff 3.5.7-1 time 1.7-1 vim 6.1-2 which 1.5-1 xpm-nox 4.2.0-1 zlib 1.1.4-1 Use -h to see help about each section > > 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 get blank line for the 1st command, in both cygwin and hpux. for 2nd on cygwin: ls -l /bin/ksh.exe -rwxr-xr-x 1 ae5460t Administ 502784 Aug 7 2002 /bin/ksh.exe on hpux: ls -l /usr/bin/ksh -r-xr-xr-x 2 bin bin 172032 Sep 16 2002 /usr/bin/ksh > > 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 > . 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_" > 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 ...] Thanks for all the help again, and for your patience. Bob -- 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/