Sponsored Content
Top Forums Shell Programming and Scripting Bash take word after specific point and till next space? Post 302523971 by hakermania on Friday 20th of May 2011 12:23:59 PM
Old 05-20-2011
Tools Bash take word after specific point and till next space?

Hello, I have an output like
Code:
Interface Chipset Driver wlan0 Intel 4965/5xxx iwlagn - [phy0]

and I want to take only the 'wlan0' string. This can be done by
Code:
a="Interface Chipset Driver wlan0 Intel 4965/5xxx iwlagn - [phy0]"
b=${a:25:6}
echo $b

The thing is that wlan0 can be something else, like eth0 or rausb0, this means that it can have more or less letters. So, what I want is to take the string from the letter No 28 till the next space. Is this possible?

Thanks Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Delete line till certain point

Hi, I have a requirement to delete a line till a certain word. Am not sure how to do it e.g I want to delete till the bold character since start of line. Any help is higly appretiated. (2 Replies)
Discussion started by: inq
2 Replies

2. UNIX for Dummies Questions & Answers

How to count the occurences of a specific word in a file in bash shell

Hello, I want to count the occurences of a specific word in a .txt file in bash shell. Can somebody help me pleaze?? Thanks!!! (2 Replies)
Discussion started by: mskart
2 Replies

3. Shell Programming and Scripting

way to print all the string till we get a space and a number

Is there any way to print all the string till we get a space and a number and store it a variable for eg we have string java.io.IOException: An existing connection was forcibly closed by the remote host 12 All I want is to store "java.io.IOException: An existing connection was forcibly closed... (13 Replies)
Discussion started by: villain41
13 Replies

4. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

5. Shell Programming and Scripting

running a script only till a point in a day

how can i run the script if its less than a particular time only in unix. for e.g the script kicks off at 9AM and looks for some file etc. I want to make sure it runs only till 12PM and then succeed the job and proceed regardless if the file exists or not. how can we do this (1 Reply)
Discussion started by: dsravan
1 Replies

6. Shell Programming and Scripting

Html parsing - get line after specific string till a point

Hi all :) It sounds complex, for example I want to find the whole html file (there are 5 entries of this string and I need to get all of them) for the string "<td class="contentheading" width="100%">", get the next line from it only till the point that says "</td>", plus removing \t (tabs) ... (6 Replies)
Discussion started by: hakermania
6 Replies

7. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

8. Shell Programming and Scripting

Fetch entries in front of specific word till next word

Hi all I have following file which I have to edit for research purpose file:///tmp/moz-screenshot.png body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: &quot;Liberation Sans&quot;; font-size: x-small; } Drug: KRP-104 QD Drug: Placebo Drug: Metformin|Drug:... (15 Replies)
Discussion started by: Priyanka Chopra
15 Replies

9. Shell Programming and Scripting

Merge lines till a particular word

Hi Experts, I have a requirement like, I have to search between 2 words (<deviceDetails> and </deviceDetails>) and merge all lines in between into 1 line. Example: <deviceDetails><subscriberName>#UNKNOWN#</subscriberName> <customerNumber>#UNKNOWN#</customerNumber>... (5 Replies)
Discussion started by: satyaatcgi
5 Replies

10. Shell Programming and Scripting

Bash directory loop, but only choose those folders with specific word in it

Hello, how in bash i can get directory loop, but only choose those folders with specific word in it, so it will only echo those with specific word #!/bin/bash for filename in /home/test/* do if ; then echo $filename; fithx! (4 Replies)
Discussion started by: ZerO13
4 Replies
WPI(4)							   BSD Kernel Interfaces Manual 						    WPI(4)

NAME
wpi -- Intel 3945ABG Wireless LAN IEEE 802.11 driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device wpi device wpifw device pci device wlan device wlan_amrr device firmware Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): if_wpi_load="YES" DESCRIPTION
The wpi driver provides support for the Intel 3945ABG Wireless network adapter wpi supports station, adhoc, and monitor mode operation. Only one virtual interface may be configured at any time. For more information on configuring this device, see ifconfig(8). This driver requires the firmware built with the wpifw module to work. FILES
/usr/share/doc/legal/intel_wpi/LICENSE wpi firmware license EXAMPLES
Join an existing BSS network (i.e., connect to an access point): ifconfig wlan0 create wlandev wpi0 inet 192.168.0.20 netmask 0xffffff00 Join a specific BSS network with network name ``my_net'': ifconfig wlan0 create wlandev wpi0 ssid my_net up Join a specific BSS network with 64-bit WEP encryption: ifconfig wlan0 create wlandev wpi0 ssid my_net wepmode on wepkey 0x1234567890 weptxkey 1 up Join a specific BSS network with 128-bit WEP encryption: ifconfig wlan0 create wlandev wpi0 wlanmode adhoc ssid my_net wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 DIAGNOSTICS
wpi%d: could not load firmware image '%s' The driver failed to load the firmware image using the firmware(9) subsystem. Verify the wpifw firmware module is installed. wpi%d: fatal firmware error An unknown error has occurred in the uploaded firmware, you may have to unload/reload the driver to continue. wpi%d: Radio transmitter is switched off The hardware switch controlling the radio is currently turned off. Data transmission is not possi- ble in this state. BUGS
Not all the error messages are documented here. Background scanning is not currently supported. SEE ALSO
wpifw(4), pci(4), wlan(4), wlan_ccmp(4), wlan_tkip(4), wlan_wep(4), ifconfig(8), wpa_supplicant(8). AUTHORS
The original wpi driver was written for OpenBSD by Damien Bergamini <damien.bergamini@free.fr>. Benjamin Close <benjsc@FreeBSD.org> ported wpi to FreeBSD. BSD
October 5, 2008 BSD
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy