[Gambas-user] stderr output via exec

Doriano Blengino doriano.blengino at ...1909...
Tue Oct 28 07:18:43 CET 2008


Mike Keehan ha scritto:
> Try using SHELL instead of EXEC.
>
> Mike.
>
>
> Ron wrote:
>   
>> Hi,
>>
>> small question., I remember something similar in a thread some time ago, 
>> but couldn't find it.
>>
>> I can't catch the stderr output from the hcitool command into a string.
>>
>> This doesn't work:
>> EXEC ["hcitool", "rssi", sAddress, "2>&1"] TO sStrength
>>
>> When I create this shell script called btgetrssi.sh :
>> --
>> #!/bin/sh
>> hcitool rssi $1 2>&1
>>     
Yes, the "2>&1" is a sh construct, not a unix one. Using EXEC [ ... 
"2>&1"] simply passes that "strange" argument to hcitool.
Use SHELL "hcitool ... 2>&1" or, more complicated but faster, an "EXEC 
... WAIT for READ" and the Error() event (but I don't know if it works 
together the WAIT keyword).

Cheers,
Doriano






More information about the User mailing list