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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string filteration with sed.

Status
Not open for further replies.

ranjank

IS-IT--Management
May 9, 2003
176
IN
Hi All,

I want to filter a particular version number which is assigned to a variable in particular file.For E.g

$ABC=/usr/local/misc/1.12
This is in xyz file.There are many such variables defined in xyz file.I want to filter version 1.12 from $ABC variable.How can i go about it.Any help will be highly appereciated.

Regards,
RK.
 
You may try this:
sed -n 's!.*/\([0-9][.0-9]*\)$!\1!p' xyz

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the reply.Can you please explain me the same as i'm newbie to this.

Rgds,
RK.
 
man sed

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top