Re: [exim] bash or perl question

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Nigel Metheringham
Date:  
À: exim-users
Sujet: Re: [exim] bash or perl question
On Fri, 2006-06-23 at 16:10 +0200, Daniel Tiefnig wrote:
> Gareth Hastings wrote:
> > cat file | awk -F. '{print $4"."$3"."$2"."$1}'
> >
> > (Less typing than above!!!!)
>
> UUOCAP (useless use of cat and pipe):
>
> awk -F. '{print $4"."$3"."$2"."$1}' file


for perl aficionados...
perl -ne 'chomp;print join(".",reverse(split(/\./)),"\n"' file

which is neither shorter, more comprehensible or more obvious than the
awk version... so I'm not sure why I posted it.

    Nigel.


-- 
[ Nigel Metheringham           Nigel.Metheringham@??? ]
[ - Comments in this message are my own and not ITO opinion/policy - ]