I'm trying to create multiple process substitutions based on the output from the other command, however I'm not sure how I can achieve that.
As sample scenario, I've given list of files:
touch a.txt b.txt c.txt d.doc e.doc f.pdf g.pdf h.xls i.xls
I'm making the list of available file extensions:
ls -1 *.* | awk -F. '{if (NF>1) {print $NF}}' | sort | uniq
Then based on my dynamic list, I'd like to create the following FIFOs like:
pr -mt <(ls -1 *.doc) <(ls -1 *.pdf) <(ls -1 *.txt) <(ls -1 *.xls)
Which would allow me to print each set in different columns. However the above list of FIFOs is hardcoded so my goal is to find some way where I can substitute dynamic number of commands (like wildcard, using eval
or xargs
somehow).
Another scenario is described in here.
I'm not interested in specific solution (workaround) to above problem, as this is only one scenario. I'm interested how I can dynamically create process substitution in shell or what additional tools I can use to achieve that.
See also: How to create anonymous FIFO?