Just another remark/question in this context. On Unix operating systems there 
is an environment
variable SHELL defined that gives the fully qualified path to the shell 
program. AFAIUI this is
meant to be the default shell to be used for executing shell scripts, if there 
is no hashbang line
in a shell script.

Therefore I would have expected that ooRexx would use that shell variable's 
value by default, and in
the case that it is not set fall back to a default shell, maybe relative to the 
Unix system running.

---rony


On 19.04.2017 22:32, Erich Steinböck wrote:
> I'm intending to fix [bugs:1430] <https://sourceforge.net/p/oorexx/bugs/1440> 
> with attached patch
> (which also fixes the broken no-shell Unix subcommands "command", and "cmd", 
> and adds subcommand
> handling for shells "dash", "tcsh", and "zsh").
>
> Before doing so, I'd like to discuss two things:
>
> 1. bash shortcut for Linux calling /bin/sh
>
> Our code in SystemCommands.cpp contains a special shortcut just for the 
> "bash" subcommand handler
> in a conditional #ifdef LINUX section.  This shortcut calls system(), which 
> in turn calls
> /bin/*sh* to execute the command.  This makes it impossible e. g. an Ubuntu 
> system, which symlinks
> /bin/sh to /bin/dash, to send a subcommand to /bin/bash.
>
> Subcommands other than "bash" are handled separately by fork()-ing and then 
> execl()-executing the
> command instead of calling system()).
>
> Does anyone know why we have this shortcut section?  Any idea why it could be 
> required?  Are there
> any known advantages/disadvantages in using system() instead of fork() / 
> execl()?
>
> The shortcut (only) also does some return code modulo 256 processing, that 
> I'd like to understand
> when/how it's required.
>
>
> 2. default shell
>
> Our code currently hard-codes the default shell for AIX to be "ksh", for SUN 
> to be "sh", and for
> all other Unix's to be "bash".  Shouldn't the default be "sh" all the time?  
> With "sh" supposedly
> being symlinked to the preferred shell for the specific platform?
>
> That could also answer René's request for a new "shell" subcommand handler, 
> that would select the
> preferred shell.
>
>
> Thanks for your thoughts.
> Erich
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to