Landon, I apologize if you have already received this patch, but I didn't get any response from the other message from either you or Simon. Here is the patch proposed by David Haller to prevent calc from inheriting stdin from bash if called from within a while loop. I've built calc with the patch and tested and it works great. Let me know if you need anything else. Thanks! -------- Original Message -------- Subject: [PATCH] Re: calc redirection of stdin causes script failues if while loop used Date: Thu, 14 Jun 2012 18:02:31 -0500 From: David C. Rankin To: Landon Curt Noll CC: David Haller Landon, Regarding the non-closure of stdin by calc when called within a while loop in BASH, David Haller (openSuSE list wizard) provided a patch that closes stdin and prevents the problem described below. What do I need to do to submit it for your consideration? Can I just provide it by this email or do I need to add it to a tracker to make sure it doesn't get lost? Let me know. Here is the patch :) Index: calc-2.12.4.4/calc.c =================================================================== --- calc-2.12.4.4.orig/calc.c +++ calc-2.12.4.4/calc.c @@ -487,6 +487,7 @@ main(int argc, char **argv) if (havecommands) { cmdbuf[cmdlen++] = '\n'; cmdbuf[cmdlen] = '\0'; + if(fclose(stdin)) { perror("main(): fclose(stdin) failed:"); } } argc_value = argc - maxindex; ALSO -- How was the Venus transit Landon? Pretty cool to see what those old anarchist Galileo and Sir Isaac were able to cobble together just from watching the sky -- no computer required... Let me know what else you guys need, if anything.