On Wed, Apr 19, 2017 at 4:32 PM, Erich Steinböck <erich.steinbo...@gmail.com
> 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.
>
I don't know if this code has been touched much from the original code
received from IBM, so I doubt it is possible to answer any of these
questions. The bash bypass sounds like a definite bug to me, so it would be
good to fix this up. I suspect this area could really use a complete
cleanup by someone who understands the issues.
>
>
> 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.
>
This sounds good to me, but I'm far from being a *ix expert.
Rick
>
>
> 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
>
>
------------------------------------------------------------------------------
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