[jira] Created: (DERBY-677) ksh scripts should be written in a more portable way
ksh scripts should be written in a more portable way Key: DERBY-677 URL: http://issues.apache.org/jira/browse/DERBY-677 Project: Derby Type: Bug Components: Demos/Scripts Versions: 10.2.0.0, 10.1.2.1 Reporter: Knut Anders Hatlen Assigned to: Knut Anders Hatlen Priority: Minor The ksh scripts in the frameworks directory are written in a way which is not totally portable. They use a syntax that is specific to ksh and not understood by the standard Bourne shell. This prevents some variants of Unix from running the scripts when you have the scripts' path in your PATH environment variable. These commands work: ksh /path/to/scripts/ij.ksh bash /path/to/scripts/ij.ksh These commands might not work on some platforms: sh /path/to/scripts/ij.ksh /path/to/scripts/ij.ksh ij.ksh # might not work even if /path/to/scripts is in PATH The syntax that is not portable is export VAR=value Rewriting it to VAR=value export VAR would make the scripts portable to all shells in the Korn and Bourne shell family. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Created: (DERBY-677) ksh scripts should be written in a more portable way
The better approach is to get rid of the scripts and replace them with ant based startup scripts as it is more portable, especially windows. I would not expect sh to work against a ksh script across the board myself anyways. Knut Anders Hatlen (JIRA) wrote: ksh scripts should be written in a more portable way Key: DERBY-677 URL: http://issues.apache.org/jira/browse/DERBY-677 Project: Derby Type: Bug Components: Demos/Scripts Versions: 10.2.0.0, 10.1.2.1 Reporter: Knut Anders Hatlen Assigned to: Knut Anders Hatlen Priority: Minor The ksh scripts in the frameworks directory are written in a way which is not totally portable. They use a syntax that is specific to ksh and not understood by the standard Bourne shell. This prevents some variants of Unix from running the scripts when you have the scripts' path in your PATH environment variable. These commands work: ksh /path/to/scripts/ij.ksh bash /path/to/scripts/ij.ksh These commands might not work on some platforms: sh /path/to/scripts/ij.ksh /path/to/scripts/ij.ksh ij.ksh # might not work even if /path/to/scripts is in PATH The syntax that is not portable is export VAR=value Rewriting it to VAR=value export VAR would make the scripts portable to all shells in the Korn and Bourne shell family.
Re: [jira] Created: (DERBY-677) ksh scripts should be written in a more portable way
To my knowledge, ksh-scripts are Korn-shell scripts, *not* Bourne-shell scripts. Since Bourne-shell is the most widely used shell, one could add bourne-shell scripts to Derby (.sh) , but one should not require Korn-shell scripts to be Bourne compatible. Knut Anders Hatlen (JIRA) wrote (2005-11-03 18:45:46): ksh scripts should be written in a more portable way Key: DERBY-677 URL: http://issues.apache.org/jira/browse/DERBY-677 Project: Derby Type: Bug Components: Demos/Scripts Versions: 10.2.0.0, 10.1.2.1 Reporter: Knut Anders Hatlen Assigned to: Knut Anders Hatlen Priority: Minor The ksh scripts in the frameworks directory are written in a way which is not totally portable. They use a syntax that is specific to ksh and not understood by the standard Bourne shell. This prevents some variants of Unix from running the scripts when you have the scripts' path in your PATH environment variable. These commands work: ksh /path/to/scripts/ij.ksh bash /path/to/scripts/ij.ksh These commands might not work on some platforms: sh /path/to/scripts/ij.ksh /path/to/scripts/ij.ksh ij.ksh # might not work even if /path/to/scripts is in PATH The syntax that is not portable is export VAR=value Rewriting it to VAR=value export VAR would make the scripts portable to all shells in the Korn and Bourne shell family. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway pgp0raoQz8Dji.pgp Description: PGP signature
Re: [jira] Created: (DERBY-677) ksh scripts should be written in a more portable way
Lance J. Andersen [EMAIL PROTECTED] writes: The better approach is to get rid of the scripts and replace them with ant based startup scripts as it is more portable, especially windows. I would not expect sh to work against a ksh script across the board myself anyways. Sure, but frameworks/readme.html explicitly says The bin subdirectory in frameworks/embedded contains scripts for running some of the Derby tools in an embedded environment. For working in an embedded environment, put the frameworks/embedded/bin subdirectory first in your path. I followed the instructions and tried to run 'ij.ksh'. I got the following error: /tmp/kh160127/tar/db-derby-10.1.2.1-bin/frameworks/embedded/bin/ij.ksh: CLASSPATH=/tmp/kh160127/tar/db-derby-10.1.2.1-bin/lib/derby.jar:/tmp/kh160127/tar/db-derby-10.1.2.1-bin/lib/derbytools.jar:: is not an identifier IMHO making the ksh scripts more portable, without breaking them on ksh, is a good thing. Not that I use the scripts, but maybe some of our users will. -- Knut Anders