Thomas Thurman on Mon, 4 Nov 2002 20:42:24 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] split & cat


On Mon, 4 Nov 2002, gabriel rosenkoetter wrote:
> On Mon, Nov 04, 2002 at 07:20:18PM -0500, Bill Jonas wrote:
> > (Incidentally, this is why you can say something like 'ren *.foo *.bak'
> > and actually have it work, whereas in a *nix-based system you would have
> > to use a for loop.  This, IMO, is the *only* redeeming feature of not
> > having the shell process the wildcards.)
> 
> That's neat, but what happens if your destinations are extant files,
> not ones you're creating, and input doesn't map cleanly to output?

It doesn't make any difference, because the wildcards have different
meanings in each argument. On the left it's rather like the Unix idea; on
the right it's more like backreferences in a regular expression.

For example: ren gets passed two arguments, "*.foo" and "*.bak". Since
each program has to do its own wildcard expansion, it makes the DOS call
which lets it iterate through the current directory finding every file
whose name matches "*.foo". Then, for example, if it finds "wombat.foo",
it expands "*.bar" to "wombat.bar" and so on.

T


_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug