Python as a scripting language. Alternative to bash script?

Paul Rubin no.email at nospam.invalid
Mon Jun 28 14:45:06 EDT 2010


John Nagle <nagle at animats.com> writes:
>    Programs have "argv" and "argc", plus environment variables,
> going in.  So, going in, there are essentially subroutine parameters.
> But all that comes back is an exit code. They should have had
> something similar coming back, with arguments to "exit()" returning
> the results.  Then the "many small intercommunicating programs"
> concept would have worked much better.

That's interesting but I'm having a hard time seeing how it would work.
I think environment variables didn't exist in early versions of Unix,
and argc/argv were passed to the child process on its stack.  I guess
the reverse side could involve the "wait" system call taking a callback
parameter with a buffer to receive the returned data.  But that still
only happens when the child actually exits, and presumably
intercommunicating netween programs should be bidirectional.  But Unix
has always had pipes for that.



More information about the Python-list mailing list