From: UnixOS2 Archive To: "UnixOS2 Archive" Date: Sat, 19 Jan 2002 04:09:32 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 109 ************************************************** Friday 18 January 2002 Number 109 ************************************************** Subjects for today 1 Re: Setting $PATH in shell script : Thomas E. Dickey" 2 Re: Setting $PATH in shell script : Thomas E. Dickey" 3 Setting $PATH in shell script : John Poltorak 4 Re: Setting $PATH in shell script : John Poltorak 5 Autoconf v2.52f installation : John Poltorak 6 Re: Setting $PATH in shell script : Holger Veit 7 Re: Setting $PATH in shell script : Holger Veit 8 Re: Setting $PATH in shell script : John Poltorak 9 EMXTUTOR : John Poltorak 10 Unix to OS/2 porting guide : John Poltorak 11 Re: Setting $PATH in shell script : Andreas Buening 12 Re: Iconv is fully available now btw : Andreas Buening 13 Re: Setting $PATH in shell script : Holger Veit 14 Re: Iconv is fully available now btw : Henry Sobotka 15 Re: Iconv is fully available now btw : Holger Veit 16 Re: Iconv is fully available now btw : Thomas Hoffmann 17 Re: Iconv is fully available now btw : John Poltorak 18 dvitools : John Poltorak 19 Re: Setting $PATH in shell script : Jun Sawataishi 20 Re: Iconv is fully available now btw : Andreas Buening **= Email 1 ==========================** Date: Sat, 19 Jan 2002 07:58:10 -0500 (EST) From: "Thomas E. Dickey" Subject: Re: Setting $PATH in shell script On Sat, 19 Jan 2002, John Poltorak wrote: > > What is the correct way to set the PATH in a shell script? > > I never know whether export is required.... > > Is it ? :- > > > PATH=... PATH=... export PATH is recognized by all Bourne shell derivatives, but "export PATH" is not recognized by the older ones. > or > > export PATH=... > > And how should paths be specified? > > > -- T.E.Dickey http://invisible-island.net ftp://invisible-island.net **= Email 2 ==========================** Date: Sat, 19 Jan 2002 08:02:15 -0500 (EST) From: "Thomas E. Dickey" Subject: Re: Setting $PATH in shell script On Sat, 19 Jan 2002, Holger Veit wrote: > This depends on the shell you use: > > Bourne shell: > PATH=/my/own/dir:$PATH > export PATH > Bash: Tecnically ksh (Korn shell) as well as pdksh, zsh and Bash, since this was originally a feature of ksh. Bash implements about half of ksh, and has some features that ksh does not. If you're concerned about script portability, Bourne shell is adequate. > export PATH=/my/ow/dir:$PATH > csh, tcsh: > set path=(/my/own/dir $path) > > Holger > > -- T.E.Dickey http://invisible-island.net ftp://invisible-island.net **= Email 3 ==========================** Date: Sat, 19 Jan 2002 10:01:37 +0000 From: John Poltorak Subject: Setting $PATH in shell script What is the correct way to set the PATH in a shell script? I never know whether export is required.... Is it ? :- PATH=... or export PATH=... And how should paths be specified? -- John **= Email 4 ==========================** Date: Sat, 19 Jan 2002 10:50:33 +0000 From: John Poltorak Subject: Re: Setting $PATH in shell script On Sat, Jan 19, 2002 at 11:30:16AM +0100, Holger Veit wrote: > On Sat, Jan 19, 2002 at 10:01:37AM +0000, John Poltorak wrote: > > > > What is the correct way to set the PATH in a shell script? > > > > I never know whether export is required.... > > > > Is it ? :- > > > > > > PATH=... > > > > or > > > > export PATH=... > > > > And how should paths be specified? > > This depends on the shell you use: > > Bourne shell: > PATH=/my/own/dir:$PATH How does this work here ? :- c:/bin:c:/usr/bin:$PATH where $PATH could be c:\os2;c:\mptn\bin; > Holger > > -- > Please update your tables to my new e-mail address: > holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) > -- John **= Email 5 ==========================** Date: Sat, 19 Jan 2002 11:18:57 +0000 From: John Poltorak Subject: Autoconf v2.52f installation I've written this simple install script for Autoconf 2.52f which should grab and install it for you in 'TESTDIR'. Amend this target to suit as well as any other paths. The target cannot include drive letters at the moment, unless you find an OS/2 version of mkinstalldirs, although I'd like to think thatthe GNU maintainers will see fit to include Andreas Buening amendments in a future distribution of Autoconf. Please give this a try and let me know how it goes. extproc c:/bin/sh -x # # requires tar, gzip, wget, awk, m4, perl, make, GNU [f|sh|t]utils # TESTDIR=/usrx CWD=`pwd` HOME=c:/home PATH=c:/usr/bin SHELL=c:/bin/sh export ac_executable_extensions=".exe" mkdir /workdir #retrieve and install autoconf v2.52f test -f autoconf-2.52f.tar.gz || wget ftp://alpha.gnu.org/pub/gnu/autoconf/autoconf-2.52f.tar.gz cd /workdir tar zxf $CWD/autoconf-2.52f.tar.gz cd autoconf-2.52f ./configure --prefix=$TESTDIR make make check make install -- John **= Email 6 ==========================** Date: Sat, 19 Jan 2002 11:30:16 +0100 From: Holger Veit Subject: Re: Setting $PATH in shell script On Sat, Jan 19, 2002 at 10:01:37AM +0000, John Poltorak wrote: > > What is the correct way to set the PATH in a shell script? > > I never know whether export is required.... > > Is it ? :- > > > PATH=... > > or > > export PATH=... > > And how should paths be specified? This depends on the shell you use: Bourne shell: PATH=/my/own/dir:$PATH export PATH Bash: export PATH=/my/ow/dir:$PATH csh, tcsh: set path=(/my/own/dir $path) Holger -- Please update your tables to my new e-mail address: holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) **= Email 7 ==========================** Date: Sat, 19 Jan 2002 12:19:42 +0100 From: Holger Veit Subject: Re: Setting $PATH in shell script On Sat, Jan 19, 2002 at 10:50:33AM +0000, John Poltorak wrote: > On Sat, Jan 19, 2002 at 11:30:16AM +0100, Holger Veit wrote: > > Bourne shell: > > PATH=/my/own/dir:$PATH > > How does this work here ? :- > > > c:/bin:c:/usr/bin:$PATH > > where $PATH could be c:\os2;c:\mptn\bin; This is not a Unix PATH. It is broken, and you know this. Holger -- Please update your tables to my new e-mail address: holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) **= Email 8 ==========================** Date: Sat, 19 Jan 2002 13:17:29 +0000 From: John Poltorak Subject: Re: Setting $PATH in shell script On Sat, Jan 19, 2002 at 12:19:42PM +0100, Holger Veit wrote: > On Sat, Jan 19, 2002 at 10:50:33AM +0000, John Poltorak wrote: > > On Sat, Jan 19, 2002 at 11:30:16AM +0100, Holger Veit wrote: > > > Bourne shell: > > > PATH=/my/own/dir:$PATH > > > > How does this work here ? :- > > > > > > c:/bin:c:/usr/bin:$PATH > > > > where $PATH could be c:\os2;c:\mptn\bin; > > This is not a Unix PATH. It is broken, and you know this. What I'm trying to get at is, supposing the current OS/2 PATH is c:\os2;c:\mptn\bin; and I want to prepend c:\bin;c:\usr\bin; in a shell script, how would I specify this? > Holger > > -- > Please update your tables to my new e-mail address: > holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) -- John **= Email 9 ==========================** Date: Sat, 19 Jan 2002 15:32:31 +0000 From: John Poltorak Subject: EMXTUTOR Just spotted this EMX tutor:- ftp://unixos2.com/incoming/EMXTUTOR.ZIP Is it worth looking at? -- John **= Email 10 ==========================** Date: Sat, 19 Jan 2002 15:37:49 +0000 From: John Poltorak Subject: Unix to OS/2 porting guide Anyone looking for a Unix to OS/2 porting guide should have a look at:- ftp://unixos2.com/incoming/UNIX2OS2.ZIP It's quite a comprehensive document, written by Arnd Hanses, who seems to have disapeared from the scene lately... Does anyone know if it's being actively maintained? -- John **= Email 11 ==========================** Date: Sat, 19 Jan 2002 15:47:59 +0100 From: Andreas Buening Subject: Re: Setting $PATH in shell script John Poltorak wrote: > [snip] > > What I'm trying to get at is, supposing the current OS/2 PATH is > c:\os2;c:\mptn\bin; and I want to prepend c:\bin;c:\usr\bin; in a shell > script, how would I specify this? export PATH="c:\blurb\foo;$PATH" bye, Andreas **= Email 12 ==========================** Date: Sat, 19 Jan 2002 15:48:15 +0100 From: Andreas Buening Subject: Re: Iconv is fully available now btw pla at cland.ru wrote: > > Hi everybody, > > In case anyone need Iconv full pack it is available in pre-release form > from Netlabs incoming gettext-os2-0.11-pre4-bin.zip > I tested it and found pretty much working. It even features iconv lib ;) The question is whether it is a good idea to have libiconv included in gettext. I could imagine two possible problems: - If a program requires gettext and the _real_ libiconv this could result in double defined symbols. E.g. GNU recode is such a candidate. - Most GNU programs have an intl subdirectory which contains an internal gettext. Will they also get an intl/os2 subdirectory? Otherwise the external and internal gettext libraries would behave differently. bye, Andreas **= Email 13 ==========================** Date: Sat, 19 Jan 2002 17:19:11 +0100 From: Holger Veit Subject: Re: Setting $PATH in shell script On Sat, Jan 19, 2002 at 01:17:29PM +0000, John Poltorak wrote: > On Sat, Jan 19, 2002 at 12:19:42PM +0100, Holger Veit wrote: > > > where $PATH could be c:\os2;c:\mptn\bin; > > > > This is not a Unix PATH. It is broken, and you know this. > > What I'm trying to get at is, supposing the current OS/2 PATH is > c:\os2;c:\mptn\bin; and I want to prepend c:\bin;c:\usr\bin; in a shell > script, how would I specify this? The shell interpreter, whatever this is, or the underlying code that provides the PATH variable (in the C API, these are "getenv()" and setenv()/putenv()) needs to take care not to export such a broken path to any UnixOS2 program; i.e. it supposedly converts any (valid in OS/2) PATH c:\os2;c:\mptn\bin to a convention understood by Unix. Your shell script will for instance then just see PATH=/drivec/os2:/drivec/mptn/bin (or whatever directory you mount the physical disk C: onto). To prepend the path c:\bin;c:\usr\bin, you as the writer of such a script, are completely on your own, as you would, for example, be as well under Unix, if you attempted to add a WWW URL to the PATH. Typically, what you would do in this environment, would be a regular /bin:/usr/bin to the path and would rely on internal putenv logic to convert this to some OS/2 path (as seen by a non-UnixOS/2 child process) as f:\unixroot\bin;f:\unixos2\usr\bin;c:\os2;c:\mptn\bin (assuming %unixroot% = f:\unixroot). The main difficulty in this is not *to convert* such env vars, but *which vars to convert*, and which not. Obviously PATH is one of them, and LIBPATH is best left untouched (it is not needed in UnixOS2 as an officially known and required variable, with the exception, that UnixOS2 apps need to find their private DLLs). Quickly guessing, I'd think PATH is the only special case - with some /etc/unixos2.conf, one would not need to see any environment variable from config.sys at all - real Unix doesn't inherit any variables from the nirvana; they all get initially set by some processes (like /sbin/init or a shell global rc file). And if so, it is in our (read: UnixOS/2 developers' and users') hands to combine correct filenames. Holger -- Please update your tables to my new e-mail address: holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) **= Email 14 ==========================** Date: Sat, 19 Jan 2002 17:27:02 -0500 From: Henry Sobotka Subject: Re: Iconv is fully available now btw Thomas Hoffmann wrote: > > .... but Henri's libxml looks for an iconv.dll and the super clever space > saving solution of supplying only an intl.dll and import libs intl.a and > iconv.a does not work! I've put the iconv.dll I built for xml2 in http://www.elzahir.org/xlibs/iconv151dll.zip (440K). It's just the DLL, i.e. no import libs or headers. hth, h~ **= Email 15 ==========================** Date: Sat, 19 Jan 2002 17:29:34 +0100 From: Holger Veit Subject: Re: Iconv is fully available now btw On Sat, Jan 19, 2002 at 03:48:15PM +0100, Andreas Buening wrote: > pla at cland.ru wrote: > > > > Hi everybody, > > > > In case anyone need Iconv full pack it is available in pre-release form > > from Netlabs incoming gettext-os2-0.11-pre4-bin.zip > > I tested it and found pretty much working. It even features iconv lib ;) > > The question is whether it is a good idea to have libiconv > included in gettext. I could imagine two possible problems: > - If a program requires gettext and the _real_ libiconv this could > result in double defined symbols. E.g. GNU recode is such a candidate. Thinking of UnixOS2 as a Unix system, what is then the difference between a "libiconv", and a "_real_ libiconv"? A UnixOS2 program should ideally not need to know anything about its emulation environment OS/2, so the library libiconv.a (and maybe a corresponding libiconv.dll) which is in its /lib or /usr/lib directory is the "_real_ libiconv". There does not exist anything which is more real. It may be that native OS/2 has an own iconv library, and that UnixOS2 libiconv is effectively a forwarder lib to such an OS/2 library (doubt this for iconv itself, but there can be such libraries); but this is then UnixOS2's reality. So look at the borderline to a Unix system: does this have a combined "gettext" and "iconv" library, and if so, this Unix will have exactly the same problem; if not, don't add broken code to UnixOS/2 and better tear off iconv from that gettext. Holger -- Please update your tables to my new e-mail address: holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection) **= Email 16 ==========================** Date: Sat, 19 Jan 2002 17:35:56 +0100 From: Thomas Hoffmann Subject: Re: Iconv is fully available now btw .... but Henri's libxml looks for an iconv.dll and the super clever space saving solution of supplying only an intl.dll and import libs intl.a and iconv.a does not work! (At least not for me: I see no simple way to construct iconv.dll from the above.) Just one word to the file sizes: libxml and gettext are packages of 1.8MB and 1.1MB. intl.dll is 14kB. Saving 14kB for a further dll (iconv.dll) lets me standing in the rain after downloading 3MB over a 33kb dialup connection .. rather frustrating. Ah, maybe some good news: if anybody is interested in pstoedit: an OS/2 package for v.3.31 can be found on pstoedit.net (what is an appropriate way to announce such stuff?) Thomas. pla at cland.ru schrieb: > > Hi everybody, > > In case anyone need Iconv full pack it is available in pre-release form > from Netlabs incoming gettext-os2-0.11-pre4-bin.zip > I tested it and found pretty much working. It even features iconv lib ;) > > Bye! -- Thomas Hoffmann Telephone: 49-351-4598831 thoffman at zappa.sax.de Dresden, Germany ..sig under construction ... **= Email 17 ==========================** Date: Sat, 19 Jan 2002 19:13:53 +0000 From: John Poltorak Subject: Re: Iconv is fully available now btw On Sat, Jan 19, 2002 at 05:35:56PM +0100, Thomas Hoffmann wrote: > .... but Henri's libxml looks for an iconv.dll and the super clever space > saving > solution of supplying only an intl.dll and import libs intl.a and > iconv.a does not work! > (At least not for me: I see no simple way to construct iconv.dll from > the above.) > > Just one word to the file sizes: libxml and gettext are packages of > 1.8MB and > 1.1MB. intl.dll is 14kB. Saving 14kB for a further dll (iconv.dll) lets > me standing > in the rain after downloading 3MB over a 33kb dialup connection .. > rather > frustrating. If ICONV.DLL is a commonly used DLL maybe it should be included with a common DLL's package. Currently UnixOS/2 provides the OS2LIBS package which consists on INTL.DLL and REGEX.DLL along with the EMX DLLs. I don't know which apps use it but it makes sense to include it if several apps do use it. > Thomas. > > pla at cland.ru schrieb: > > > > Hi everybody, > > > > In case anyone need Iconv full pack it is available in pre-release form > > from Netlabs incoming gettext-os2-0.11-pre4-bin.zip > > I tested it and found pretty much working. It even features iconv lib ;) > > > > Bye! > > -- > Thomas Hoffmann Telephone: > 49-351-4598831 > thoffman at zappa.sax.de Dresden, > Germany > > ..sig under construction ... -- John **= Email 18 ==========================** Date: Sat, 19 Jan 2002 19:29:29 +0000 From: John Poltorak Subject: dvitools If anyone knows what dvitools are useful for, you can grab them from:- http://www.ilyaz.org/software/os2/dviutils-os2-bin.zip -- John **= Email 19 ==========================** Date: Sat, 19 Jan 2002 20:28:33 +0900 From: Jun Sawataishi Subject: Re: Setting $PATH in shell script > >What is the correct way to set the PATH in a shell script? > >I never know whether export is required.... > >Is it ? :- > > >PATH=... > >or > >export PATH=... > >And how should paths be specified? I recommend you to add a line below to your configuration file specified by CONFIG_SITE env. var. PATH=`cmd.exe /c "echo %PATH%" | sed -e 's at \\\\ at / at g'` By this, "x:\foo" is converted to "x:/foo" **= Email 20 ==========================** Date: Sat, 19 Jan 2002 20:32:07 +0100 From: Andreas Buening Subject: Re: Iconv is fully available now btw Holger Veit wrote: > > On Sat, Jan 19, 2002 at 03:48:15PM +0100, Andreas Buening wrote: > > pla at cland.ru wrote: > > > > > > Hi everybody, > > > > > > In case anyone need Iconv full pack it is available in pre-release form > > > from Netlabs incoming gettext-os2-0.11-pre4-bin.zip > > > I tested it and found pretty much working. It even features iconv lib ;) > > > > The question is whether it is a good idea to have libiconv > > included in gettext. I could imagine two possible problems: > > - If a program requires gettext and the _real_ libiconv this could > > result in double defined symbols. E.g. GNU recode is such a candidate. > > Thinking of UnixOS2 as a Unix system, what is then the difference between > a "libiconv", and a "_real_ libiconv"? [snip] That's a misunderstanding. ;-) The new OS/2 patches that have been included into the offical GNU gettext tree contain a intl/os2/iconv.c file that exports the GNU libiconv functions but internally it uses the OS/2 Unicode API. On the other side the "real" libiconv i.e. the "official standalone GNU libiconv" contains its own several 100kB of character sets. gettext/intl/os2/iconv.c is small but restricted to (installed) OS/2 charsets while GNU libiconv supports dozens or hundreds of different charsets of different OSes and computer systems. GNU recode is one of the packages that require the GNU libiconv. I only wanted to say that if a program requires gettext _and_ libiconv you might get a "double defined symbols" error if you link with -lintl -iconv. Or imagine the following configure script: checking for gettext (gcc -lintl ...): yes => use it checking for libiconv (gcc -lintl -liconv ...): no (because of double defined symbols) => no libiconv will be used bye, Andreas