The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-22-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,245
Quote:
Originally Posted by bryan
how do i get a word that exists between two words

eg: this is bryan
My input to command would be this and bryan
and output should be 'is'

Is there a command i can use?


Code:

sed -n 's/word1[ ][ ]*\([^ ]*\)[ ][ ]*/\1/p'