* Re: [gentoo-user] sed/awk question
@ 2011-11-22 3:01 99% ` Pandu Poluan
0 siblings, 0 replies; 1+ results
From: Pandu Poluan @ 2011-11-22 3:01 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
On Nov 22, 2011 9:57 AM, "Adam Carter" <adamcarter3@gmail.com> 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?
>
sed -r -e 's/(.*)-[0-9].*/\1/'
[-- Attachment #2: Type: text/html, Size: 461 bytes --]
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2011-11-22 2:52 [gentoo-user] sed/awk question Adam Carter
2011-11-22 3:01 99% ` Pandu Poluan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox