Click here to Skip to main content
15,860,972 members
Home / Discussions / Linux Programming
   

Linux Programming

 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Valentinor10-Jun-19 5:22
Valentinor10-Jun-19 5:22 
QuestionEDITED Where and how to change DBus security access to "name "? ( Added Link at the front of the original post.) Pin
Vaclav_2-Jun-19 5:19
Vaclav_2-Jun-19 5:19 
QuestionPost deleted by author Pin
Vaclav_24-May-19 4:54
Vaclav_24-May-19 4:54 
AnswerRe: Help with analyzing bluetooth "hci_inquiry" function Pin
Richard MacCutchan24-May-19 5:01
mveRichard MacCutchan24-May-19 5:01 
AnswerRe: Post deleted by author Pin
Richard MacCutchan27-May-19 5:28
mveRichard MacCutchan27-May-19 5:28 
QuestionLooking to figure out how to design a desktop and theme for an operating system based off of Linux. Can anyone point me in the right direction on how to do this? Anyone know of any books? Any tips? Any pointers? Any Forums? etc. The other parts are a Pin
justinsloan3217-May-19 22:18
justinsloan3217-May-19 22:18 
AnswerRe: Looking to figure out how to design a desktop and theme for an operating system based off of Linux. Can anyone point me in the right direction on how to do this? Anyone know of any books? Any tips? Any pointers? Any Forums? etc. The other parts a Pin
Richard MacCutchan17-May-19 22:21
mveRichard MacCutchan17-May-19 22:21 
QuestionPARTIALLY SOLVED hcitool scan with grep pipe Pin
Vaclav_17-May-19 14:14
Vaclav_17-May-19 14:14 
could somebody assist me with resolving the following issues?

I am trying to extract BD (bluetooth device) address form "hcitool scan" command.
I am having two issues.

1. When I use the attached code in terminal it returns expected BD addresses, The requested output is "color coded" so I have highlighted the actual output.
It is working exactly what the grep options are specified.

I am stomped as far as how to option grep to retrieve the LAST part of the address.
I did try to option for SPECIFICALLY retrieve only five of the hex with colon (Smile | :) combinations , for testing purposes , but it didn't work.

I am assuming that would be one way to get the whole address -retrieve five combinations of hex / colon and then retrieve the last two hex digits.

Here is my attempt do retrieve the five hex / colon combinations

hcitool scan | grep '[[:xdigit:]]\{2\}:]\{5\}'


I do not need references to man, I am asking for code help.


This following code partially works retrieving five hex / colon combinations


pi@pi:~ $ hcitool scan | grep '[[:xdigit:]]\{2\}:'
	00:50:B6:80:4D:5D	jim-desktop




Addendum
SOLVED
Retrieved full address by "reversing" the grep - processing FIRST hex number then processing colon /hex combination five times.

pi@pi:~ $ hcitool scan | grep -i '[[:xdigit:]]\{2\}\(:[[:xdigit:]]\{2\}\)\{5\}'
	00:50:B6:80:4D:5Djim-desktop


2. This issue is very puzzling. The code which works as expected in terminal bombs when used in C++. Now the hcitool has "build in" delay when "scan" is implemented. That is NORMAL Bluetooth "inquiry response" behavior. When used as "hcitool scan" it takes few seconds to detect the bluetooth device(s). The response shows up in stdout and in my case it is written to tmp file.
All normal.
The problem is "grep" - when output form scan is piped thru there is no output whatsoever.
It makes no difference if hcitool is implemented as "sudo" on not.
Only some unspecified hcitool commands actually need to be run as "sudo" , scan is not one of them.

I understand there are other "extracting" commands, however, I would prefer to resolve both of these issues using grep.

As always , help with code is very much appreciated.





system("sudo hcitool scan | grep '[[:xdigit:]]\{2\}:'2>&1  | tee /tmp/address.txt ");


modified 19-May-19 1:18am.

AnswerRe: analyze "grep" pipe Pin
Richard MacCutchan17-May-19 21:18
mveRichard MacCutchan17-May-19 21:18 
QuestionHow to retrieve "terminal" output? Pin
Vaclav_17-May-19 7:26
Vaclav_17-May-19 7:26 
AnswerRe: How to retrieve "terminal" output? Pin
Richard MacCutchan17-May-19 9:27
mveRichard MacCutchan17-May-19 9:27 
QuestionTheoretical server/site setup Pin
pyango58-May-19 12:00
pyango58-May-19 12:00 
QuestionSOLVED "configure" script option PKG_CONFIG_DEBUG_SPEW fails to run on X86 Pin
Vaclav_4-May-19 3:51
Vaclav_4-May-19 3:51 
GeneralRe: "configure" script option PKG_CONFIG_DEBUG_SPEW fails to run on X86 Pin
Richard MacCutchan4-May-19 4:56
mveRichard MacCutchan4-May-19 4:56 
Questionmissing mount.pc Pin
Vaclav_12-Apr-19 3:49
Vaclav_12-Apr-19 3:49 
AnswerRe: missing mount.pc Pin
Gerry Schmitz12-Apr-19 4:53
mveGerry Schmitz12-Apr-19 4:53 
GeneralRe: missing mount.pc Pin
Vaclav_12-Apr-19 7:53
Vaclav_12-Apr-19 7:53 
QuestionBad UDP length 736 > IP payload length Len = 728 packet drop Pin
sarali8-Apr-19 18:35
sarali8-Apr-19 18:35 
AnswerRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
Gerry Schmitz9-Apr-19 6:22
mveGerry Schmitz9-Apr-19 6:22 
AnswerRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
Randor 10-Apr-19 21:26
professional Randor 10-Apr-19 21:26 
GeneralRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
sarali12-Apr-19 20:43
sarali12-Apr-19 20:43 
GeneralRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
Randor 28-Apr-19 12:50
professional Randor 28-Apr-19 12:50 
GeneralRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
sarali10-May-19 2:55
sarali10-May-19 2:55 
PraiseRe: Bad UDP length 736 > IP payload length Len = 728 packet drop Pin
Randor 10-May-19 11:18
professional Randor 10-May-19 11:18 
QuestionActive PID Pin
Mohibur Rashid4-Apr-19 15:05
professionalMohibur Rashid4-Apr-19 15:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.