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 -->
  #1 (permalink)  
Old 02-16-2007
prkfriryce prkfriryce is offline
Registered User
 

Join Date: Nov 2006
Posts: 44
basic cat replace string

trying to exclude hostnames ending in "s" from a host file:

Code:
# cat hosts
ssef
ssefd
ssefsfff
ssefsfs
# for x in `cat hosts`; do echo "${x/*s}" ;done
ef
efd
fff

#

How can I echo/or not echo only 'ssefsfs' ??

thanks
Reply With Quote
Remove advertisements
!!
Forum Sponsor