The UNIX and Linux Forums  

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



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-19-2008
Franklin52 Franklin52 is offline
Moderator
 

Join Date: Feb 2007
Posts: 1,965
Or with sed:

Code:
echo "/opt/ibm/lotus/ibw/latest" | sed 's!\(.*lotus\).*!\1!'
gives: /opt/ibm/lotus

Code:
echo "/opt/ibm/lotus/ibw/latest" | sed 's!.*lotus\(.*\)!\1!'
gives: /ibw/latest


Regards
Reply With Quote