↧
Answer by Pavel for Feeding Multiline STDIN Input to Command
Yeah, it's a bit tricky, but let me show you this example: Here's the test data $ cat a 1 2 3 Here's what you tried (I guess) $ cat a | xargs echo foo foo 1 2 3 Here's how to make it work using xargs:...
View ArticleAnswer by Robert Dundon for Feeding Multiline STDIN Input to Command
Turns out, you can do this just using a while loop in bash (adapted from this answer): <whatever your command/output is> | while read line; do echo $line; done Where echo is your command and...
View ArticleFeeding Multiline STDIN Input to Command
I have a script that outputs git repository SSH URLs, like this: git@example.com:namespace/project.git git@example.com:another_namespace/some_other_project.git I want to run the command git clone (or...
View Article