xargs -i
24 Mar 2014This post is a just a tid-bit for the use of xargs in bash.
If you can get a list of work to do from a file or stream, you can pipe these into xargs
to do further work. An example of this, I’ve taken from here. This will find all of the *.bak in or below the current directory and delete them.
Extending the usage of xargs
to incorporate the -i
switch, you can replace “{}” with the line of text read in the preprended command.
In this command, it’s expected that the file “url_endings” would be data that looks like this: