[ale] command fails thru xargs but succeeds from shell prompt
Tim Watts
tim at cliftonfarm.org
Sat Jan 29 16:01:58 EST 2011
Yeah, I tried it w/o the 2nd quotes but it complained when some of the
dirs had spaces in them. However, that -print0 would probably work.
Would be more elegant than the sh -c kludge I settled on. I'll try that
on a 2nd batch. Thanks.
On Sat, 2011-01-29 at 15:43 -0500, Mark Heiges wrote:
> You're double quoting - in the printf and again for the mv. Try this
>
> find Video/* -maxdepth 0 -type d -printf "\"%p\"\n" | xargs -tn1 -
> I"{}" mv -v {} /alt/video/
>
> or use find's --print0 with xarg's -0 options.
>
> find Video/* -maxdepth 0 -type d -print0 | xargs -0 -tn1 -I"{}" mv -
> v {} /alt/video/
>
>
> On Jan 29, 2011, at 3:24 PM, Tim Watts wrote:
>
> > I'm trying to move some files. When I try it using xargs it fails but
> > when I try the exact same command at the shell prompt that xargs
> > echoes
> > it succeeds.
> >
> > Here's the command:
> >
> > $ find Video/* -maxdepth 0 -type d -printf "\"%p\"\n" | xargs -tn1
> > -I"{}" mv -v \"{}\" /alt/video/
> >
> > Here's what happens when I run it:
> >
> > mv -v "Video/Weeds - Season 1" /alt/video/
> > mv: cannot stat `"Video/Weeds - Season 1"': No such file or directory
> > ...
> >
> > But when I just run the mv command it succeeds. What's going on here?
> >
> >
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://mail.ale.org/mailman/listinfo/ale
> > See JOBS, ANNOUNCE and SCHOOLS lists at
> > http://mail.ale.org/mailman/listinfo
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
More information about the Ale
mailing list