Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


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

[Discuss] GNU xargs trick



On 4/27/2016 12:18 PM, Daniel Barrett wrote:
> Nice trick. I'd recommend using "find -print0" and "xargs -0" for
> safety, in case any of your PNG filenames contain space characters:

Mine don't but it's a good practice anyway in the general case.


On 4/27/2016 12:31 PM, Mike Small wrote:
> New line characters in particular. -I changes matters to line at a
> time so other space characters should be okay, right?

Yes, line at a time, but you may need to quote the substitution string
in the command arguments.


On 4/27/2016 1:14 PM, MBR wrote:
> Very cool! I've used xargs for many years, but I never knew about the
> -I or -P options. Are they only in the GNU implementation, or have
> they been ported to other platforms?

xargs on recent Macintosh has these options. YMMV with other Unix-likes.

-- 
Rich P.



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org