[Gambas-user] No EXEC Output but Works in Terminal

Doriano Blengino doriano.blengino at ...1909...
Tue Mar 3 23:35:48 CET 2009


A Person ha scritto:
> Good Day . . .
>
> I am using Gambas 2.8.2-1ubuntu1.
>
> I wrote a program that randomly displays a line from a text file. The 
> code worked in pure Gambas but then I tried to improve it! (Ho Ho Ho)
>
> I searched around and I came up with and modified an executable BASH 
> script (test.sh) that worked substantially faster than my code so I 
> tried to incorporate it into the source code.
>
> During my testing I continuously ran tests in a terminal and 
> everything worked perfectly with the script. I tried it in my code using
>
> ## EXEC ["~/test.sh"] to sOutPut or EXEC ["~/./test.sh"] to sOutPut
>
> and nothing worked. sOutPut was always "".
>
> The attached tar file contained a small program that contains an 
> example EXEC problem code. A modified test.sh script is included along 
> with a dummy data file, words.txt.
>
> Any ideas about the EXEC problem?
Hi, "A person"...

read about the EXEC statement. You need to specify the WAIT clause, 
otherwise your script is launched in background, and gambas goes ahead 
without waiting for your script to output anything - so sOutput remains 
empty.

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list