in reply to changing file extensions

What OS and shell? I wouldn't even use Perl. I'd just say "rename *.bob *.fred" on the command line. Or, if it has subdirs, "global rename *.bob *.fred".

Replies are listed 'Best First'.
Re: Re: changing file extensions
by Zaxo (Archbishop) on Aug 03, 2001 at 10:52 UTC

    rename from to files... on *nix.

    $ rename .bob .fred *.bob

    After Compline,
    Zaxo

Re: Re: changing file extensions
by abstracts (Hermit) on Aug 03, 2001 at 03:25 UTC
    Hello

    "I wouldn't even use Perl. I'd just say "rename *.bob *.fred" on the command line."

    But you are using Perl, since rename is written in Perl :-)

    Aziz,,,

    Update:Many people seem to vote without reading the followups, so, here it is:

    RENAME(1) Perl Programmers Reference Guide RENAME(1) NAME rename - renames multiple files SYNOPSIS rename [ -v ] perlexpr [ files ] DESCRIPTION "rename" renames the filenames supplied according to the rule specified as the first argument. The perlexpr argu? ment is a Perl expression which is expected to modify the "$_" string in Perl for at least some of the filenames specified. If a given filename is not modified by the expression, it will not be renamed. If no filenames are given on the command line, filenames will be read via standard input. For example, to rename all files matching "*.bak" to strip the extension, you might say rename 's/\e.bak$//' *.bak To translate uppercase names to lower, you'd use rename 'y/A-Z/a-z/' * [snip] AUTHOR Larry Wall
    Aziz,,,
      No, it's a shell intrinsic command.
      [D:\Program Files\4nt]rename /? Rename files or subdirectories. RENAME [/A:[[-]rhsda] /E /I"text" /NPQST] old_name... new_name /A:(ttribute select) /P(rompt) /E (no error messages) /Q(uiet) /I (match description) /S(ubdirectory) /N(othing) /T(otal) [D:\Program Files\4nt]
        Hello again

        Apparently we're talking about 2 different renames:

        RENAME(1) Perl Programmers Reference Guide RENAME(1) NAME rename - renames multiple files SYNOPSIS rename [ -v ] perlexpr [ files ] DESCRIPTION "rename" renames the filenames supplied according to the rule specified as the first argument. The perlexpr argu? ment is a Perl expression which is expected to modify the "$_" string in Perl for at least some of the filenames specified. If a given filename is not modified by the expression, it will not be renamed. If no filenames are given on the command line, filenames will be read via standard input. For example, to rename all files matching "*.bak" to strip the extension, you might say rename 's/\e.bak$//' *.bak To translate uppercase names to lower, you'd use rename 'y/A-Z/a-z/' * [snip] AUTHOR Larry Wall