News for hackers. Stuff that matters.
Re:A Unix Utility to Know About: lsof (2009) by LukeShu on Friday August 26, 2016 @10:57PM (#12370699)
What shell are you using? I could see a naive shell forking twice without exec, but I don't know of a shell that does that. Exec just says "don't fork(3) before calling exec(3)", but, but inside of a pipeline like that, it shouldn't fork again anyway. I have tried it with and without.
Re:A Unix Utility to Know About: lsof (2009) by _c_ on Friday August 26, 2016 @11:10PM (#12370757)
In theory it should not make a difference but my scripts seem to run faster when I use exec after pipe.

Normally I would only add exec to the last command in the script, as djb does. But then I started experimenting with using it after pipes.

If you or anyone can explain why this could make scripts "seem" to execute faster, I would be grateful.

Here's the shell source: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-7/src/bin/sh

Incidentally, have you ever tried execlineb? I use that sometimes too.