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



David Laight <david%l8s.co.uk@localhost> writes:

> On Mon, Jan 14, 2013 at 10:14:40PM +0100, tlaronde%polynum.com@localhost 
> wrote:
>> Isn't find(1) -printx exactly designed for this ?
>
> Possibly, but the combination of 'find -print0' and 'xargs -0'
> is a more sane solution to the quoting problem.
>
> I'm not sure when xargs 'won' support for quoting characters with ', "
> and \ - I'm fairly sure it wasn't in the first version I used!
>
> xargs probably ought to have options to:
> - set the field separator characters
> - disable quoting, or maybe select between different type of quoting
>     eg, current, shell (might be what it does now), ls -b, vis

I thought a lot when I first ran into this problem.

I see several consistent solutions after having learnt about line feeds
in file names, and the solution around sh is introduction of record
separator (in AWK terms) into all necessary tools, including ls, head,
tail, sort, sed, and some others. Another solution is not using unix tools
for any complex and dangerous scripting.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index