OESF Portables Forum

General Forums => General Discussion => Topic started by: bam on February 23, 2006, 04:02:42 am

Title: Scripting
Post by: bam on February 23, 2006, 04:02:42 am
I have the output of hcitool scan, now I want to 'cut' out each line with linefeed delimiters, I have tried actually 'embedding" the lf(return) chr in the script, this does not return what I am looking for and if I use "tab" which is what separates the output from the 2nd line down, again doesnt return what I expect, Anyone have an idea how I just return the mac address with the name? BTW I am dumping this into a select box using opie-sh. Perhaps searching a wildcard pattern with grep is a better approach? if so how?  Any ideas greatly appreciated.
Title: Scripting
Post by: Meanie on February 23, 2006, 08:26:16 am
Quote
I have the output of hcitool scan, now I want to 'cut' out each line with linefeed delimiters, I have tried actually 'embedding" the lf(return) chr in the script, this does not return what I am looking for and if I use "tab" which is what separates the output from the 2nd line down, again doesnt return what I expect, Anyone have an idea how I just return the mac address with the name? BTW I am dumping this into a select box using opie-sh. Perhaps searching a wildcard pattern with grep is a better approach? if so how?  Any ideas greatly appreciated.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=115838\")

maybe this will help you [a href=\"http://zaurus.daemons.gr/menaie/build/bluetooth-gui]http://zaurus.daemons.gr/menaie/build/bluetooth-gui[/url]
Title: Scripting
Post by: datajerk on February 23, 2006, 10:56:14 am
Quote
I have the output of hcitool scan, now I want to 'cut' out each line with linefeed delimiters, I have tried actually 'embedding" the lf(return) chr in the script, this does not return what I am looking for and if I use "tab" which is what separates the output from the 2nd line down, again doesnt return what I expect, Anyone have an idea how I just return the mac address with the name? BTW I am dumping this into a select box using opie-sh. Perhaps searching a wildcard pattern with grep is a better approach? if so how?  Any ideas greatly appreciated.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115838\"][{POST_SNAPBACK}][/a][/div]
It would be helpful if you could provide the output and the output you want to generate.

Assuming you get:
Code: [Select]
$ hcitool scan
Scanning ...
        00:00:00:01:02:03       PC
        00:00:00:aa:bb:cc       PHONE
Assuming you want:
Code: [Select]
$ hcitool scan | grep : | awk '{print $1 " " $2}'
00:00:00:01:02:03 PC
00:00:00:aa:bb:cc PHONE
Title: Scripting
Post by: bam on February 23, 2006, 03:54:16 pm
perfecto! I must spend more time with scripting...
Title: Scripting
Post by: datajerk on February 23, 2006, 05:59:40 pm
Quote
perfecto! I must spend more time with scripting...
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=115910\")
Start here:

[a href=\"http://www.oreilly.com/catalog/shellsrptg/index.html]http://www.oreilly.com/catalog/shellsrptg/index.html[/url]
Title: Scripting
Post by: Antikx on February 24, 2006, 12:10:13 am
Quote
maybe this will help you http://zaurus.daemons.gr/menaie/build/bluetooth-gui (http://zaurus.daemons.gr/menaie/build/bluetooth-gui)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115858\"][{POST_SNAPBACK}][/a][/div]

Is you're email address correct in the start of that script?
Title: Scripting
Post by: bam on February 24, 2006, 02:03:33 am
Quote
Quote
perfecto! I must spend more time with scripting...
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=115910\")
Start here:

[a href=\"http://www.oreilly.com/catalog/shellsrptg/index.html]http://www.oreilly.com/catalog/shellsrptg/index.html[/url]
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115920\"][{POST_SNAPBACK}][/a][/div]


thanks, i will do some good reading...

Bam
Title: Scripting
Post by: Meanie on February 24, 2006, 10:38:25 am
Quote
Quote
maybe this will help you http://zaurus.daemons.gr/menaie/build/bluetooth-gui (http://zaurus.daemons.gr/menaie/build/bluetooth-gui)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115858\"][{POST_SNAPBACK}][/a][/div]

Is you're email address correct in the start of that script?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115942\"][{POST_SNAPBACK}][/a][/div]

yep, that's my email.