[ale] command fails thru xargs but succeeds from shell prompt

Mark Heiges mheiges at gmail.com
Sat Jan 29 15:43:21 EST 2011


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



More information about the Ale mailing list