[Gambas-user] stderr output via exec

Ron ron at ...1740...
Tue Oct 28 08:53:13 CET 2008


Doriano Blengino schreef:
> 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).
>
>
>   

Yes SHELL works, I tried it before but then other params where 
preventing to let it work right I guess.

Thanks!

Regards,
Ron_2nd




More information about the User mailing list