Eric Laffoon, środa, 13 września 2006 16:07:
>On Wednesday 13 September 2006 6:45 am, divi wrote:
>> hi to everybody..i have this problem
>> i have to grep tish command "hcitool
scan" to capture MAC number
>> output(in a TextEdit)..but i can't..because this
command give this
>> output "Scanning...MAC_ADDRESS" and
seems there is no way to cut-off
>> "Scanning..." from output
>> Is very important because the next button i
created, "grep" TextEdit2
>> output and connect automatically to that
mac_number.
>> If not..this button can't grep TextEdit2 because
TextEdit2 is
>> "Scanning...MAC_ADDRESS"
>> so everytime i have to copy/paste mac address in
the textedit below
>> tnx for answer
I don't know about hcitool, but here is an example for
ifconfig.
It is a bit tricky for old parser:
LineEdit1.setText( String.replace( String.section( exec("/sbin/ifconfig
eth0 | grep HWaddr "), "HWaddr", 1),
" ", ""))
New parser makes it simpler (or at least more clear)
line = exec("/sbin/ifconfig eth0 | grep HWaddr
")
mac = str_section(line, " HWaddr ", 1)
mac = str_replace(mac, " ", "")
LineEdit1.setText(mac)
--
Michal Rudolf
_______________________________________________
Kommander mailing list
Kommander kdewebdev.org
http://mail.kdewebdev.org/mailman/listinfo/kommander
|