List Info

Thread: (no subject)




(no subject)
user name
2006-09-13 13:45:12
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
_______________________________________________
Kommander mailing list
Kommanderkdewebdev.org

http://mail.kdewebdev.org/mailman/listinfo/kommander
(no subject)
user name
2006-09-13 14:07:59
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

It's too sleepy in the morning for these questions...

Okay, if you're using grep you must be using an exec, in
which case you can 
use "cut". Personally I find the String
functions in Kommander easier. Once 
again I ask... Did you look in the function browser? If you
know how long the 
opening string is you can use...
String.right("your string", expr(String.length("your string")-10))
Disclaimer: Not responsible for typos before coffee and
without using that 
wonderful Function Browser to make the phrase.
-- 
Eric Laffoon
Project Lead - kdewebdev module
_______________________________________________
Kommander mailing list
Kommanderkdewebdev.org

http://mail.kdewebdev.org/mailman/listinfo/kommander
(no subject)
user name
2006-09-13 17:24:26
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
Kommanderkdewebdev.org

http://mail.kdewebdev.org/mailman/listinfo/kommander
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )