Starting from here I tried to read a file and emit the head and the tail of the file (reading the file only once).
I tried the following:
tee >(head) >(tail) > /dev/null < text.txt
This line works as expected, but I'd like to get rid of the /dev/null. So I tried:
tee >(head) | tail < text.txt
But this line does not work as expected (well, as I expected), it prints the head but does not return after that. Apparently tail is waiting for something. But I don't know what for exactly. I found this SO question, but I could not get it running with the given answers.