![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing variables of one shell script in another shell script | rsendhilmani | Shell Programming and Scripting | 2 | 03-17-2009 01:17 AM |
| Script to Scan proclog files | deeprajn95 | Shell Programming and Scripting | 3 | 05-12-2008 06:25 AM |
| Perl script to scan back lines | gholdbhurg | Shell Programming and Scripting | 3 | 03-18-2008 12:33 PM |
| Perl script to scan through files | gholdbhurg | Shell Programming and Scripting | 1 | 03-05-2008 10:53 PM |
| port scan shell script | nrbhole | Shell Programming and Scripting | 3 | 01-31-2008 11:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
hcitool scan via shell script
Hello,
Im new to shell scripting , and i have the following question . The hcitool scan command returns the bluetooth address of the phone . When it is run the output is something like Code:
Scanning....
00:A1:5D:AB:B2:E9 Nokia 6600
I tried redirecting the output to a file, as follows Code:
hcitool scan > addr Please help. Thanks. Last edited by rahulkhn; 07-15-2008 at 08:02 PM.. |
|
||||
|
Maybe the second bit of output is sent to stderr instead of stdout? Try hcitool scan > addr 2>&1.
If that works, use this to get it into a variable: Code:
addr=$(hcitool scan 3>&1 >/dev/null 2>&3 | awk '{print $1}')
Last edited by Annihilannic; 07-15-2008 at 09:19 PM.. Reason: typo |
| Sponsored Links | ||
|
|