[Centos] help with xargs and mv
Dag Wieers
dag at wieers.com
Wed Feb 9 18:59:03 UTC 2005
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 at wieers.com, http://dag.wieers.com/ --
[all I want is a warm bed and a kind word and unlimited power]
More information about the CentOS
mailing list