Re: Bash Script to move Files

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

 



On Mon, Oct 10, 2005 at 12:37:11PM +0800, Ow Mun Heng wrote:
> On Mon, 2005-10-10 at 12:33 +0800, Ow Mun Heng wrote:
> > On Fri, 2005-10-07 at 23:02 -0700, Gordon Messmer wrote:
> > > 
> > > The name of the file that matches the contstraints you described to 
> > > "find" is substituted for the {} after -exec.  Since mv expects the 
> > > source before the destination, you'd need to use "mv {} /destination"
> > 
> > or use xargs -i
> 
> Actually, that's wrong. just use xargs.
> 
> $ find . -iname "*.tmp" -maxdepth 1 -type f | xargs mv '{}' /location

That's completely wrong:

$ mkdir x
$ touch x/a x/b x/c
$ find x | xargs echo mv '{}' /location
mv {} /location x x/a x/b x/c
$

-- 
print+qq&$}$"$/$s$,$*${d}$g$s$@$.$q$,$:$.$q$^$,$@$*$~$;$.$q$m&if+map{m,^\d{0\,},,${$::{$'}}=chr($"+=$&||1)}q&10m22,42}6:17*2~2.3@3;^2dg3q/s"&=~m*\d\*.*g


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux