Work-around for process substitution in mksh An extremely useful feature of Bash, known as process substitution, is missing in the Android shell, mksh. This is highly unfortunate as it prevent you from doing things like:

diff &lt;(sort list1) &lt;(sort list2)


The mksh site has marked this as a "future plan" here. So my questions is:

Are there any work-arounds for this? (And what are they?)
Apparently the only (?) way to do this, is by using a named pipe like this:

mkfifo myp1 || exit
mkfifo myp2 || exit
sort list1 &gt;myp1 &amp;
sort list2 &gt;myp2 &amp;
diff myp1 myp2 
rm -f myp1 myp2


This need to be put into a mksh shell function in order to be of any real command line use. Another tricky part seem to be that AOS has implemented some kind of timeout that kills or messes up the pipe, if not used within a few seconds. (Reason unknown.)