From owner-freebsd-questions Tue Apr 25 13: 2: 6 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id 3F72237BA0A for ; Tue, 25 Apr 2000 13:01:58 -0700 (PDT) (envelope-from Doug@gorean.org) Received: from slave (doug@slave [10.0.0.1]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id NAA38660; Tue, 25 Apr 2000 13:01:49 -0700 (PDT) (envelope-from Doug@gorean.org) Date: Tue, 25 Apr 2000 13:01:49 -0700 (PDT) From: Doug Barton X-Sender: doug@dt051n0b.san.rr.com To: Alfred Perlstein Cc: Greg Pavelcak , freebsd-questions@FreeBSD.ORG Subject: Re: Making sh script pause for input In-Reply-To: <20000425110642.D9754@fw.wintelcom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 25 Apr 2000, Alfred Perlstein wrote: > * Doug Barton [000425 11:01] wrote: > > Greg Pavelcak wrote: > > > > > > This is driving me nuts. I want a script that prompts with a > > > student's name and then waits for input regarding that student > > > then moves on. I've tried using xargs and a script like this: > > > > The bad news, you can't do that with sh because once you tell it to > > take its input from a file that's where it's going to take all of its > > input from. The good news, this is a really easy perl script, and this > > kind of processing is one of the things perl is really good for. > > Actually... :) > > http://www.complete.org/mailinglists/archives/aclug-l-199811/msg00018.html > > explains some really nifty things you can do with sh and filehandles. None of which apply to the original poster's exmple. He wants to read from the real stdin while inside a loop which is already reading its stdin from a file. If you can do what the author asked for in sh, I'd love to see it. I'm as big of a bourne shell scripting advocate as anyone, but there are some things that it doesn't do well, and this is one of them. Doug -- Excess on occasion is exhilarating. It prevents moderation from acquiring the deadening effect of a habit. -- W. Somerset Maugham To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message