Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Or for cut command

Status
Not open for further replies.

msen

IS-IT--Management
Apr 24, 2001
36
US
CustDirNam=`echo $OutFile|cut -f1 -d.||cut -f1 -d_`

If this right ?
 
Try something like this:
Code:
CustDirNam=`echo $OutFile|sed 's![._].*!!`

Hope This Help
PH.
 
PH, please explain the sed expression that you posted above. Not familiar with it. Thanks.
 
pavNell,
Code:
's![._].*!!`
s    substitue
!    pattern delimiter
[._] either point or underscore
.*   any character until the end of string
!!   empty replacement string
Anyway:
Code:
man sed

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top