[X-Unix] What unix command ?
Xavier Noria
fxn at hashref.com
Mon Sep 26 12:36:49 PDT 2005
On Sep 26, 2005, at 20:24, Richard Nagle wrote:
> Looking for a unix command's that can do the following:
>
> inside a folder on my desktop, there are txt documents,
> that I need to fix the file names...
>
> ie:
>
> message: fixing the mac power supplyeml..txt
>
> Now look at the end of this message, its a .txt file,
> however, I need to do this:....
>
> going backwards, from ; .txt and remove the eml,
> then slide over the .txt,
>
> So the end results are;
> message: fixing the mac power supply.txt
I tested this, but please try it first on a copy of the directory:
% cd directory_with_the_files_to_rename
% /bin/ls *eml..txt | perl -nle '/(.*)eml/ && rename $_, "$1.txt"'
-- fxn
More information about the X-Unix
mailing list