perl -ne '/\A(.).*(.)\Z/; print $1, $2;' test

would do it as long as you stick to a single line...

-Mark Ivey-


On Wed, 2002-11-20 at 13:56, Matthew Boeckman wrote:
> I know this is a little OT, but thought someone might have a quick 
> answer. I'm trying to match the first and or last letter in a single 
> word textfile. So, assume a file called test, with the contents: abcdef .
> What I'm after is the return af .
> 
> I thought that
> 
> grep -G \<\> test
> 
> would do it, but no! Likewise awk variants didn't seem to do it either. 
> Am I missing anything obvious?
> 
> -- 
> Matthew Boeckman                      (816) 777-2160
> Manager - Systems Integration         Saepio Technologies
-- 
Mark Ivey <[EMAIL PROTECTED]>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to