[Centos] help with xargs and mv

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



James B. Byrne wrote:
> 
> cat file4 | 	xargs mv /var/spool/mqueue/'{}' \
> 			/var/spool/mqueue/offline 

To provide an alternate way (thanks Dag, learned a new xargs switch :) ) 
I would instintively write this bash command as:

   while read filename && [[ "$filename" != end ]]
   do
     mv -f "/var/spool/mqueue/$filename" /var/spool/mqueue/offline/
   done < "/path/to/file4"

hth,
-te

-- 
Troy Engel | Systems Engineer
Fluid, Inc | http://www.fluid.com

[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