gary@loki.scc.COM (Gary Bisaga) (06/27/87)
Franco: I am sure that you have received a din of letters so far about this, but please put up with one more. Csh forks when executing commands under certain conditions: when a command is being timed with the builtin command "time" (not, of course, if "/bin/time" is being used), or when the command is not a "simple" builtin, this being defined as a non-builtin, any command (builtin or not) whose output is piped into another process, and so on. What is confusing is that most commands work properly in this way. For example, "history | more" works just fine, because the forked shell inherits the history list variable from its parent csh. However, the "jobs" command is pid-sensitive and so doesn't work as expected. By the way, you will notice several other commands that do the same thing. For example, "kill %% | more" doesn't work for the exact same reason (there is no current child of the forked shell process). The example "limit filesize 1000 | more" doesn't work as expected either (although for a different reason). In this last case, the forked shell receives a copy of the parent shell's local variables (one of them being the filesize limit), but, as they exist in a different area of real memory, cannot change them. I hope this all helps. Yours in Unix, Gary Bisaga (gary@loki.scc.com)