News for hackers. Stuff that matters.
Re:Hints for writing Unix tools by grosskur on Tuesday October 21, 2014 @01:15AM (#8485992)
You can simulate this with so-called "Bernstein chaining". Basically, each program takes another program as an argument, and finishes by calling exec() on it rather than exit(), which preserves the environment. See:

http://www.catb.org/~esr/writings/taoup/html/ch06s06.html

Or write environment variables to stdout in Bourne shell syntax so the caller call run "eval" on it. Like ssh-agent, for example.

Re:Hints for writing Unix tools by gohrt on Tuesday October 21, 2014 @01:21AM (#8486018)
Re:Hints for writing Unix tools by agumonkey on Tuesday October 21, 2014 @01:20AM (#8486015)
Oh wow, unix continuation passing style. Never heard of that o_o;