bug-coreutils
[Top][All Lists]
Advanced

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

Re: Feature Request: add wildcards and recursive to ln


From: James Youngman
Subject: Re: Feature Request: add wildcards and recursive to ln
Date: Wed, 20 Feb 2008 20:40:36 +0000

On Feb 20, 2008 4:21 PM, Vincent J. Schiavoni <address@hidden> wrote:
> Hello:
>
> Please consider adding features to ln to allow recursive linking of
> files in a directory and the use of wildcards to support that feature.
>
> At present, there appears to be no way to link large numbers of files in
> a "batch"-type mode - each file must be linked individually, or a
> work-around used such as for example "for i in /usr/local/lib/*; do ln
> -s $i /usr/lib/ ; done".  It would be nice to have that functionality
> integrated into ln.

How would that improve ln though?   What if you wanted to do this with
hard links for files while creating actual directories for those
directories in the source?   What if you wanted to include hideen
files too?   What if you wanted to do this only for read-only files
(and copy the writable files instead of linking them)?   Would you put
all that functionality into ln too?

Whoa.   Suddenly with all that handling of recursion and directory
tree walking, ln has grown from 584 lines of C to 2500.  It seems
cumbersome to greatly increase the size of the code for use patterns
that are only useful a small fraction of the time.  Interestingly you
already proposed an equivalent program that does what you need in
about 50 bytes, by building on top of the existing ln utility.  I
assume it would only take 5 minutes or so to make that command line (1
to type it and maybe 4 to figure out that actually, $i needs quoting).

You might also find it helpful to read
http://en.wikipedia.org/wiki/Unix_philosophy (which, perhaps rightly,
points out that many GNU tools lean towards significant complexity).

James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]