![]() |
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 |
| Perl config file Help | Harikrishna | Shell Programming and Scripting | 6 | 05-20-2008 04:51 AM |
| Copy data and send it to other file, with diff config | single | Shell Programming and Scripting | 0 | 01-29-2008 09:56 AM |
| Extracting data from text file based on configuration set in config file | suparnbector | Shell Programming and Scripting | 3 | 08-10-2007 02:25 AM |
| Using loop reading a file,retrieving data from data base. | Sonu4lov | Shell Programming and Scripting | 1 | 01-19-2007 03:38 AM |
| using config file | mape | Shell Programming and Scripting | 1 | 09-07-2006 01:37 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
sorry, there is one problem...
the file may have some interfaces like eth0 or ath0.. ie, my file looks like this Quote:
thanks for ur help |
|
|||||
|
Your sed statement should now be
Code:
sed -n -e '/^\[.*]/{
N
s#^\[\(.*\)\]\nESSID=\(.*\)#\1=\2#p
}' esham.txt
- for any line starting with [ followed by some combination of characters and then a closing ] - append the next line into the pattern space - For the two lines that are present in the pattern space, collect the interfaces and its value and print it. - Read the entries from esham.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|