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

Tim Watts tim at cliftonfarm.org
Sat Jan 29 15:38:28 EST 2011


Never mind. Looks like xargs just runs the target command as a child
process but not in a shell. So my quotes were getting in the way. I
worked around it by wrapping the mv command in sh -c '...'.


On Sat, 2011-01-29 at 15:24 -0500, 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