0

I remember seeing a unix command that would take lines from standard input and execute another command multiple times, with each line of input as the arguments. For the life of me I can't remember what the command was, but the syntax was something like this:

ls | multirun -r% rm %

In this case rm % was the command to run multiple times, and -r% was an option than means replace % with the input line (I don't remember what the real option was either, I'm just using -r as an example). The complete command would remove all files in the current by passing the name of each file in turn to rm (assuming, of course, that there are no directories in the current directory). What is the real name of multirun?

4

1 回答 1

3

该命令称为“xargs”:-),您可以按以下方式运行它

ls | xargs echo I would love to rm -f the files

于 2013-06-07T22:32:55.573 回答