Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a pipe map in bash? [closed]

Tags:

bash

cmd1 | cmd2

will call cmd2 only once with cmd1 output as argument. What i want is call cmd2 one by one with each line of cmd1 output as argument. Maybe something looks like:

cmd1 | map cmd2

I know I can write one by myself, just want to know is there a built-in support already?

like image 656
Dagang Avatar asked Oct 21 '25 07:10

Dagang


1 Answers

cmd1 | xargs -l cmd2

This is my favorite way. Thank you Paulo Ebermann!

like image 154
Dagang Avatar answered Oct 23 '25 22:10

Dagang