Mikkel L. Ellertson wrote:
>> I see your grep and raise you a sed:
>>
>>   sed 's/.*[^0-9]//' foo.txt >new_file.txt
>>
> What happens if there is a number in the middle of the line of text,
> as well as at the end? Wouldn't that give you more text then desired?

No, because .* is greedy.  The .* will consume all but the very last
non-numeric character (including numeric chars before the last
non-numeric), then [^0-9] will consume the last non-numeric char.

Matt Flaschen

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Reply via email to