extraction of sting
Given the input :
busybox-1.11.1-1_WR3.0bg.armv6jel_vfp.rpm i want to extract what comes before ".rpm" i.e, busybox-1.11.1-1_WR3.0bg.armv6jel_vfp |
if that's a proper description of the issue, i.e. remove the .rpm suffix, just use "basename $STRING .rpm"
|
suppose my input is like this
busybox-1.11.1-1_WR3.0bg.armv6jel_vfp.rpm = 1.1111.2l2 i want to extract busybox-1.11.1-1_WR3.0bg.armv6jel_vfp from the given input line given characters may follow ".rpm" I dont want anything after ".rpm" using sed or awk command |
Or, if you are using bash then you could use bash's own String manipulation mechanism, e.g.
Code:
echo ${STRING%.rpm*} [edit]: Just saw your latest post. So is it correct to assume that this line is inside a file and not stored in a variable? In this case: Code:
sed 's/\.rpm.*$//' inputfile |
Yes...perfect ...it worked just as i wanted it to......:D
Thanks a zillion.... |
All times are GMT -5. The time now is 04:36 PM. |