From owner-freebsd-questions Tue Apr 25 8:45:57 2000 Delivered-To: freebsd-questions@freebsd.org Received: from greed.zenspider.com (greed.zenspider.com [216.39.164.65]) by hub.freebsd.org (Postfix) with SMTP id 3946037BE28 for ; Tue, 25 Apr 2000 08:45:54 -0700 (PDT) (envelope-from ryand@zenspider.com) Received: (qmail 36024 invoked from network); 25 Apr 2000 15:44:09 -0000 Received: from lust.zenspider.com (HELO ?216.39.164.68?) (216.39.164.68) by greed.zenspider.com with SMTP; 25 Apr 2000 15:44:09 -0000 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Tue, 25 Apr 2000 08:45:39 -0700 To: Greg Pavelcak From: Ryan Davis Subject: Re:Making sh script pause for input Cc: freebsd-questions@freebsd.org Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 10:04 -0400 on 2000-04-25, you wrote: 0D >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: > > >#!/bin/sh > >while read LOGNUM CLASS LNAME FNAME GPA MAJOR ; >do >echo $FNAME $LNAME ; >echo -n "Status? " ; >read STATUS ; >echo "$LOGNUM $CLASS $LNAME $FNAME $GPA $MAJOR $STATUS" >> newfile ; >done < contractsS00 I don't think 'read' exists in the bourne shell, but it does in bash. Some UNIX-like systems (and you know who you are) ship with bash as /bin/sh, so that might be where you have seen it used. Bash installs very easily out of the ports. Personally, I always do things like this with perl, and then wrap the perl w/ a shell script if it must be a shell script. -- Ryan Davis -=- Zen Spider Software -=- mailto:ryand@ZenSpider.com -=- http://www.ZenSpider.com/ -=- I know that you believe you understand what you think I said but, I'm not sure you realize that what you heard is not what I meant. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message