0

Possible Duplicate:
Should I care about unnecessary cats?

Both would be functionally equivalent, but when using cat wouldn't it be slower because you have a process first reading the file and then sending it through a pipe to another process, instead of the process just reading the file? But I've seen this usage 'cat file | program' in a lot of examples. I assume they wouldn't use it that much in examples if it had bad performance.

sashoalm
  • 5,820

1 Answers1

5

Yes, but the bigger slowdown would be starting up the first process(cat).

However, seeing as how the difference is minimal on any computer made in the last 15 years that isn't loaded down very heavily(load avg < 30), the bigger disadvantage is code readability.

Kevin M
  • 1,973