Piping commandline output through while loop

As I often forget the exact syntax – here is a working example (using osc to search for build results of a specific package in all projects that have this package):

while read line ; do case $line in [a-z]*) echo; echo $line; osc results $line ;; esac; done < <(osc se mosh)

so the following chars (and the whitespaces between them) are important at the end of the wile loop:

< <()


About Lars Vogdt

This is the private blog space of Lars Vogdt, the topics will be in first place work related.
Aside | This entry was posted in openSUSE, SUSE Linux Enterprise and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s