Pandu Poluan pa...@poluan.info wrote:
On Tue, Nov 22, 2011 at 10:26, Adam Carter adamcart...@gmail.com wrote:
sed -r -e 's/(.*)-[0-9].*/\1/'
You know, that looks familiar... are you trying to get a package name from
the list of eix-installed? :-)
No - its non-gentoo. In this case it
On Tue, Nov 22, 2011 at 16:40, Joerg Schilling
joerg.schill...@fokus.fraunhofer.de wrote:
Pandu Poluan pa...@poluan.info wrote:
On Tue, Nov 22, 2011 at 10:26, Adam Carter adamcart...@gmail.com wrote:
sed -r -e 's/(.*)-[0-9].*/\1/'
You know, that looks familiar... are you trying to get a
On 11/22/2011 10:40 AM, Joerg Schilling wrote:
Here's an alternative:
sed -r -e 's/-[0-9].*//'
Nust a note: sed has no option -r and 's/(.*)-[0-9].*/\1/' is a garbled
command. A corrected version would be 's/\(.*\)-[0-9].*/\1/'
So the main question is: why do you use a non-existing
Pandu Poluan pa...@poluan.info wrote:
sed -r -e 's/-[0-9].*//'
Nust a note: sed has no option -r and 's/(.*)-[0-9].*/\1/' is a garbled
command. A corrected version would be 's/\(.*\)-[0-9].*/\1/'
So the main question is: why do you use a non-existing option?
# sed --help
Usage:
Hi All,
I need to cut a string, which happens to be a filename, using the
first dash that's followed by a numeral, so cut -f 1 -d- fails if
the filename has an extra dash. How do i do this?
sed -r -e 's/(.*)-[0-9].*/\1/'
You know, that looks familiar... are you trying to get a package name from
the list of eix-installed? :-)
No - its non-gentoo. In this case it hasn't worked
$ echo net-snmp-5.3.2.2-5.cp843034001.i386.rpm | sed -r -e 's/(.*)-[0-9].*/\1/'
net-snmp-5.3.2.2
I'd use sed and the regex -[0-9] to delimit the field
foo=`echo '123--bad-2xyz-3--' | sed -r -e s/-[0-9].*//`
echo $foo
123--bad
Helpful?
Adam Carter wrote:
Hi All,
I need to cut a string, which happens to be a filename, using the
first dash that's followed by a numeral, so cut -f 1 -d-
Oh, and you can get the other end next by
foo2=`echo '123--bad-2xyz-3--' | sed -r -e s/$foo//`
echo $foo2
-2xyz-3--
Joseph Davis wrote:
I'd use sed and the regex -[0-9] to delimit the field
foo=`echo '123--bad-2xyz-3--' | sed -r -e s/-[0-9].*//`
echo $foo
123--bad
Helpful?
Adam Carter
On 11/21/2011 06:52 PM, Adam Carter wrote:
Hi All,
I need to cut a string, which happens to be a filename, using the
first dash that's followed by a numeral, so cut -f 1 -d- fails if
the filename has an extra dash. How do i do this?
Here's a Bourne parameter expansion:
blee@eclipse ~ $
I'd use sed and the regex -[0-9] to delimit the field
foo=`echo '123--bad-2xyz-3--' | sed -r -e s/-[0-9].*//`
echo $foo
123--bad
Helpful?
Perfect - thanks!
On Tue, Nov 22, 2011 at 10:26, Adam Carter adamcart...@gmail.com wrote:
sed -r -e 's/(.*)-[0-9].*/\1/'
You know, that looks familiar... are you trying to get a package name from
the list of eix-installed? :-)
No - its non-gentoo. In this case it hasn't worked
$ echo
11 matches
Mail list logo