I am experimenting with named pipes in Ubuntu and have no prior experience with them. I did the following:
mkfifo pipe ls>pipe& cat pipe
This enters a list of all files in my folder into
pipe and displays them. I am trying to read the pipe 2 lines at a time. So, I want a command when executed once, will give the names of first and second files in the folder. If the command is executed again, I want third and fourth filenames. Is there any way to do it?
head -2 pipe. It displayed first two filenames. But when it was executed again, it hanged. What would be the right direction to proceed?