In bash command line, if I run "find . -name 'abc*' ", it prints out a list of filenames like
abc1
abc2
abc3
How can I pipe it with echo or other command, so that i get this output:
abc1 ok
abc2 ok
abc3 ok
The += Operator in Bash Bash is a widely used shell in Linux, and it supports the '+=' operator to concatenate two variables. As the example above shows, in Bash, we can easily use the += operator to concatenate string variables.
Simply:
$ find . -name 'abc*' | xargs -I {} echo {} OK
You could use xargs
:
find -iname "abc" | xargs -IREPL echo REPL ok
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With