Author Topic: Scripting  (Read 3010 times)

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Scripting
« 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.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Scripting
« Reply #1 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]

maybe this will help you [a href=\"http://zaurus.daemons.gr/menaie/build/bluetooth-gui]http://zaurus.daemons.gr/menaie/build/bluetooth-gui[/url]
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Scripting
« Reply #2 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

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Scripting
« Reply #3 on: February 23, 2006, 03:54:16 pm »
perfecto! I must spend more time with scripting...
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Scripting
« Reply #4 on: February 23, 2006, 05:59:40 pm »
Quote
perfecto! I must spend more time with scripting...
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
Start here:

[a href=\"http://www.oreilly.com/catalog/shellsrptg/index.html]http://www.oreilly.com/catalog/shellsrptg/index.html[/url]

Antikx

  • Hero Member
  • *****
  • Posts: 1147
    • View Profile
    • http://tyrannozaurus.com
Scripting
« Reply #5 on: February 24, 2006, 12:10:13 am »
Quote
maybe this will help you 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?
Kanpai,
-Antikx (Twitter, Mugshot and PodNova)
C1000 - pdaXrom R198 (Celestial Environment)
tyrannozaurus.com
[img]http://www.tyrannozaurus.com/files/category_pictures/general_1.png\" border=\"0\" class=\"linked-sig-image\" /]
Zaurus news/blogs feed from Zaurus users
Free Windows, Linux, or Web RSS readers.
Featured pages at tyrannozaurus:
Sharp Petition, ScummVM, Cacko, pdaXii13, and Celestial Environment

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Scripting
« Reply #6 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]
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
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Scripting
« Reply #7 on: February 24, 2006, 10:38:25 am »
Quote
Quote
maybe this will help you 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.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K