[Centos] help with xargs and mv

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



On Wed, 9 Feb 2005, James B. Byrne wrote:

> Thank you for that clarification.
> 
> Now what happens is this:
> 
> #cat workmv | xargs -i mv ./mqueue/'{}' ./mqueue/offline
> mv: cannot stat `./mqueue/*j17KeeL7025621': No such file or 
> directory
> mv: cannot stat ... one for each entry in workmv
> 
> #
> # ll ./mqueue/*j17KeeL7025621
> -rw-------	1 root	root		19397	Feb  7 15:41 
> ./mqueue/dfj17KeeL7025621
> -rw-------	1 root	smmsp	1812		Feb  8 13:41 
> ./mqueue/qfj17KeeL7025621
> 
> Do I need to escape the leading * in the workfile?

Please do not add the * in workmv, but add it to the cmdline. Like:

	xargs -i mv ./mqueue/*'{}' ./mqueue/offline

The quotes around {} escapes the wildcard, so it loses its special 
meaning. I would used ?? (or {df,qf}) instead of *, but it makes no big 
difference.

Kind regards,
--   dag wieers,  dag@xxxxxxxxxx,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux