[Gambas-devel] Problems with Process and bash replacement

José Luis Redrejo jredrejo at ...176...
Fri Dec 8 17:24:10 CET 2006


Hi all,
in some distributions bash is being replaced by dash to speed up the start
up of the system.
It seems that bash is overbloated and things go faster using dash.
So they are linking /bin/sh to /bin/dash instead of /bin/bash

Testing it I've noticed is a little faster (not apreciable in fast computers
but it's much better in slow ones).
So the replacement could be a good thing.... unless you're a gambas
programmer and use to be a SHELL fan.

This code doesn't work properly using dash as replacement to bash:

Dim stuffProcess AS Process
    TRY stuffProcess = SHELL ("whatever you like")
    TRY stuffProcess.Kill
     stuffProcess = NULL


After executing it I can see as "sh" is killed, but "whatever you like" is
still alive. Using bash, both sh & "whatever you like" are killed.

I know this is not a real gambas bug, probably is due to the limitations of
dash,
but we are going to deal with it sooner or later, so if anybody has any idea
on how to do it, or if Benoît knows how to solve it
thinking in the future, any help is welcome.

P.S. I've checked that TRY stuffProcess = SHELL ("whatever you like")
launch two processes, with consecutive id:
"sh" with id = stuffProcess.id and "whatever you like" with id=
StuffProcess.id +1, so this has worked for me:

Dim stuffProcess AS Process
dim idProcess as integer
    TRY stuffProcess = SHELL ("whatever you like")
     idProcess= stuffProcess.id
     TRY SHELL("kill -9 " & cstr(stuffProcess.id))
     TRY SHELL("kill -9 " & cstr(stuffProcess.id +1 ))
     stuffProcess = NULL

But, obviously this is just rubbish and I wouldn't like to have to use it,
and even I'm not sure it will work the same with
different systems or distributions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20061208/44c0969d/attachment.html>


More information about the Devel mailing list