Solution to Lab 13 ------------------ 1. Not really a question here. 2. The command first invoked will "wait" (i.e., hang). In this case, the "cat" will hang instead of the "ls" as in question 1. 3. You must first create a named pipe called 'produce-consume' before executing the following scripts. The answer to the producer part is: #!/bin/bash while [ 1 != 2 ] do echo Please enter a command: read cmd echo $cmd > produce-consume done The answer to the consumer part is: #!/bin/bash while [ 1 != 2 ] do cmd=`cat produce-consume` echo Received command: $cmd result=`$cmd > temp 2>&1` cat temp done 4. The consumer will happily consume the commands from both producers, in the order in which they are sent to the pipe. 5. This is a little tricky. Only one consumer (and not both) will consume the command. But it may not be clear who that is apriori (i.e., it should appear non-deterministic). 6. First in first out. This is the manner in which stuff written into a pipe is read out of it.