Re: hcitool lescan scripting question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Edmund,

On Tuesday 11 of November 2014 12:11:02 Urbani, Edmund wrote:
> 
> Hello,
> 
> now this may seem like a silly question, but I have been trying to do some 
> simple shell scripting with hcitool's LE scan and redirected its out and err 
> streams. The result is not quite what I am expecting:
> 
> hcitool lescan --duplicates > /tmp/lescan.out
> 
> This will create the output file immediately, but it remains empty until the 
> hcitool process terminates. Only then does the entire output get flushed. Any 
> idea why the output does not get written immediately? Ie. why I can't "tail -f 
> /tmp/lescan.out"?
> 
> My intention was to pipe the output through a shell script to add a timestamp to 
> each line, so I get a simple log during testing. I did not want to modify 
> hcitool/write my own C program just for this purpose.

This is due to stdout buffering. Try with stdbuf:
stdbuf -oL hcitool lescan --duplicates > /tmp/lescan.out

-- 
Best regards, 
Szymon Janc
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux