> Message: 13
> From: "Reuben D Budiardja" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Change file extension using bash (OT)
> Date: Mon, 11 Feb 2002 23:39:10 -0500
> Reply-To: [EMAIL PROTECTED]
> 
> 
> Hi,
> I need a bit of help with bash here. I try to create a script that would 
> change the extension of files in directory. I have files like 
> xxx.pc that I want a change to xxx.jpg, where xxx is numbers, in a directory. 
> How can I do that using bash?
> 
> thanks for any help.
> Reuben D.B.

for oldname in *.pc; do
    mv $oldname ${oldname/%.pc/.jpg}
done


--
        pete peterson
        Teradyne, Inc.
        7 Technology Park Drive
        Westford, MA 01886-0033

        [EMAIL PROTECTED] or [EMAIL PROTECTED]
        +1-978-589-7478 (Teradyne); +1-978-589-2088 (Closest FAX);
        +1-978-589-7007 (Main Teradyne Westford FAX)
 



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to