tech-userlevel archive

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

Re: bin/44246: enhance mv to work better with xargs



In article <20130114160124.473ef9e6.jklowden%schemamania.org@localhost>,
James K. Lowden <tech-userlevel%netbsd.org@localhost> wrote:
>On Sat, 12 Jan 2013 20:21:59 -0600
>schnoebe%netbsd.org@localhost (Eric Schnoebelen) wrote:
>
>> I've taken a look at bin/44246 and attempted to implement an
>> enhancement to resolve the PR.
>
>I really don't see the problem.  
>
>       $ echo * | xargs mv newdir
>
>fails, yes, but 
>
>       $ echo * newdir | xargs mv 
>
>works.
>
>Acknowledged, sometimes the input to xargs might require a subshell 
>
>       $(brutal complexity; echo newdir) | xargs mv
>
>to acheive the same ends, but I agree with Mouse: are we going to
>change every utility that requires arguments in a specific order?  

That is very dangerous if the expansion exceeds ARG_MAX - 4096.
At least it will not do what you expect and you'll have to go fishing
around to find your files.

christos



Home | Main Index | Thread Index | Old Index