Bug 9172 - multiple rename (gmc and elsewhere)
multiple rename (gmc and elsewhere)
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gmc (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-02-06 23:09 EST by Stig Hackvan
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-14 15:10:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stig Hackvan 2000-02-06 23:09:40 EST
problem:  you can move a bunch of files to the same directory, but you
can't change their names all at once.

solution:  roughly speaking, i want this feature to appear wherever renames
are possible in a gui:  i want to be able to rename a bunch of files all at
once with (perhaps several different options of) a predictable and useful
outcome.

-- stig/jato (pts/5) -- Sun Feb  6 -- 20:07:25 --
-- ...ainofstig.ai/vox/pw/200106 > touch foo bar ; mvnum foo bar fubar
foo -> fubar-1
bar -> fubar-2
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:07:43 --
-- ...ainofstig.ai/vox/pw/200106 > touch foo bar ; mvnum foo bar fubar
foo -> fubar-3
bar -> fubar-4
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:07:45 --
-- ...ainofstig.ai/vox/pw/200106 > rm fubar-*
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:07:54 --
-- ...ainofstig.ai/vox/pw/200106 > touch foo.txt bar.txt ; mvnum foo.txt
bar.txt fubar
foo.txt -> fubar-1.txt
bar.txt -> fubar-2.txt
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:08:30 --
-- ...ainofstig.ai/vox/pw/200106 > touch foo.txt bar.txt ; mvnum foo.txt
bar.txt fubar
foo.txt -> fubar-3.txt
bar.txt -> fubar-4.txt
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:08:31 --
-- ...ainofstig.ai/vox/pw/200106 > touch foo.txt bar.txt bing.c ; mvnum
foo.txt bar.txt bing.c fubar
foo.txt -> fubar-5.txt
bar.txt -> fubar-6.txt
bing.c -> fubar-7.c
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:09:04 --
-- ...ainofstig.ai/vox/pw/200106 > ls fu*
fubar-1.txt  fubar-3.txt  fubar-5.txt  fubar-7.c
fubar-2.txt  fubar-4.txt  fubar-6.txt
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:09:09 --
-- ...ainofstig.ai/vox/pw/200106 > rm fu*
-- stig/jato (pts/5) -- Sun Feb  6 -- 20:09:17 --
-- ...ainofstig.ai/vox/pw/200106 > wh mvnum
mvnum is a function
mvnum ()
{
    : "mvnum <f1> <f2> ... <name-prefix> -- mass file rename";
    perl -e '
    $pre=pop(@ARGV); $n=1;
    foreach $x (@ARGV) {
      $x =~ m/(\.[^.]+)$/;
      do { $y = "$pre-$n$1"; ++$n; } until (! -f $y);
      print "$x -> $y\n";
      rename($x, $y);
    }' "$@"
}
Comment 1 Preston Brown 2000-02-14 15:10:59 EST
will not be supported in the near future, and probably never by gmc.  May be
supported by its replacement.

Note You need to log in before you can comment on or make changes to this bug.