On 2002-09-22 21:53, Peter Leftwich <[EMAIL PROTECTED]> wrote:
> You know, it's sad but in all my nine (9) years of grepping, I never once
> used the "$" -- the "^" for "line beginning with" yes, but never the
> immensely useful "$" in order to obtain the .xxx extensions :)
> 
> That leads me to wonder about using "rev" to reverse the order of
> characters on the line and "cut" using a field delimiter of "."  :)  :)

You probably could, and then use rev to fix the lines back to their
normal form too.

        rev | cut -d. -f2- | rev

You can do that with sed(1) too, though:

        sed -e 's/\.[^.]*$//'

Both of these should strip the `.xxx' extension of all input lines.
Then, there's Perl, awk, and a few other tools.  Practically unlimited
ways of doing the same thing :)

Giorgos.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to