The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check position of end of line(URGENT PLS) evvander Shell Programming and Scripting 6 11-11-2007 02:46 PM
check position of end of line for some specific lines senthil_is Shell Programming and Scripting 1 11-08-2007 10:19 PM
how to check a word in a file and assign to a variable hippo2020 Shell Programming and Scripting 1 06-28-2007 09:00 AM
Change Position of word character cedrichiu Shell Programming and Scripting 6 03-11-2007 10:52 PM
Can a shell script pull the first word (or nth word) off each line of a text file? tricky Shell Programming and Scripting 5 08-17-2006 03:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 01-03-2008
rikxik's Avatar
Registered User
 

Join Date: Dec 2007
Posts: 105
Talking

Thanks for pointing that out. This should lay such issues to rest:

Code:
$ cat file
 window 0 truck 3 duck 2 spitfire 8 fire 1 backfire 9
$ sed 's/.*\<fire\> \([0-9][0-9]*\).*/\1/' file
1
$ sed 's/.*\<spitfire\> \([0-9][0-9]*\).*/\1/' file
8
$ sed 's/.*\<window\> \([0-9][0-9]*\).*/\1/' file
0
$ sed 's/.*\<backfire\> \([0-9][0-9]*\).*/\1/' file
9
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0