Re: [Hampshire] Executing a command on a list of files?

Top Page

Reply to this message
Author: Andy Random
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Executing a command on a list of files?

Thanks Andy, Dan.

On Thu, 22 Feb 2007, Daniel Pope wrote:
> Or, if your filenames potentially contain spaces, you may need
>
> cat /some/list ./of/many ./files | xargs -I '{}' whatever_command '{}'


In this case there wasn't and Andy's solution worked fine.

However in future I guess there might be (IMO spaces in filenames are evil
and should be outlawed, but sadly not everyone agrees with me)
unfortunately when I tried the xargs solution I found that the version of
xargs installed on the machine doesn't like the -I option.

Both the machines I've tried it on (one FC one Debian) are using
GNU xargs version 4.1.20, any idea which version I need to support -I?

Andy