Hi I am really having trouble understanding the concept behind pipe and fork command especially when trying to read input from a file
Printable View
Hi I am really having trouble understanding the concept behind pipe and fork command especially when trying to read input from a file
Not 100% clear on what you mean but if you are talking about operating systems, the I guess | is a pipe and < and > are forks. Is that what you mean?
That being the case the pipe takes the utput of one program and passes it into another eg ls -l | wc -l where the ls-l gives the directory list and passes it to wc -l which counts the number of lines.
< and > redirect the output to or from files. So ls - l > listing.txt, gives the directory list and prints it in listing.txt. If its the other way round it will count the number of lines in listing.txt
I hope that what you mean and if its incorrect I hope someone can correct me cos I haven't used it for a while :(