Click here to Skip to main content
15,867,308 members
Home / Discussions / Linux Programming
   

Linux Programming

 
AnswerRe: Windows 7 vs Windows 10?? Pin
Tuche18-Jul-19 2:20
Tuche18-Jul-19 2:20 
QuestionLinux OS for a new user Pin
Member 1450955522-Jun-19 22:33
Member 1450955522-Jun-19 22:33 
AnswerRe: Linux OS for a new user Pin
Eddy Vluggen23-Jun-19 0:11
professionalEddy Vluggen23-Jun-19 0:11 
AnswerRe: Linux OS for a new user Pin
#realJSOP23-Dec-19 0:56
mve#realJSOP23-Dec-19 0:56 
QuestionOpening JavaFX jar on Ubuntu [SOLVED] Pin
Valentinor7-Jun-19 21:08
Valentinor7-Jun-19 21:08 
AnswerRe: Opening JavaFX jar on Ubuntu Pin
Richard MacCutchan8-Jun-19 0:25
mveRichard MacCutchan8-Jun-19 0:25 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Valentinor8-Jun-19 6:38
Valentinor8-Jun-19 6:38 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Richard MacCutchan8-Jun-19 6:48
mveRichard MacCutchan8-Jun-19 6:48 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Valentinor8-Jun-19 7:49
Valentinor8-Jun-19 7:49 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Richard MacCutchan8-Jun-19 21:50
mveRichard MacCutchan8-Jun-19 21:50 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Valentinor9-Jun-19 7:27
Valentinor9-Jun-19 7:27 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Richard MacCutchan9-Jun-19 21:41
mveRichard MacCutchan9-Jun-19 21:41 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Valentinor10-Jun-19 5:08
Valentinor10-Jun-19 5:08 
GeneralRe: Opening JavaFX jar on Ubuntu Pin
Richard MacCutchan10-Jun-19 5:16
mveRichard MacCutchan10-Jun-19 5:16 
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 

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.