On Thu, 2010-07-08 at 13:45 -0400, Steve Litt wrote:
> On Thursday 08 July 2010 12:49:12 William L. Thomson Jr. wrote:
> > On Thu, 2010-07-08 at 12:16 -0400, Paul Spicer wrote:
> > > I have a folder of text files with no extension (named 101, 102, 103,
> > > etc...) and I wanted to add an extension of .tab to them. So, in
> > > terminal, I ran 'rename * *.tab *' and file 101 was deleted. Can
> > > anyone tell me why?
> > 
> > Because your command took 101 and made it 102. Go check 102 and it will
> > have the contents of 101. Rename is similar to move, and your wildcards
> > are pickup up the next entry.
> > 
> > Why it stops there, not sure, likely matches first two lines, puts line
> > 1 into line 2, 101 -> 102, and job finished. But other files
> > modification times do reflect they have been touched.
> > 
> > But not the desired outcome you are seeking. Not sure of the syntax for
> > that, and might have reached the limits on rename. Seems to not handled
> > advanced stuff well, just simple rename.
> 
> That's if he used mv. Now there's a Perl script called "rename" that does 
> what 
> he wants:
> 
> rename 's/$/\.tab/' 1??
> 
> See the rename man page.

Not to be confused with the rename command thats part of util-linux-ng.
Which does not support the above syntax, though does not error out
either interestingly enough. It might support some variant.

>From man rename

AVAILABILITY
       The rename command is part of the util-linux-ng package and  is  avail-
       able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

-- 
William L. Thomson Jr.
Obsidian-Studios, Inc.
http://www.obsidian-studios.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
List archive http://marc.info/?l=jaxlug-list&r=1&w=2
RSS http://www.mail-archive.com/[email protected]/maillist.xml

Reply via email to