Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2000 10:04:57 -0400 (EDT)
From:      Greg Pavelcak <gpav@som.umass.edu>
To:        freebsd-questions@freebsd.org
Subject:   Making sh script pause for input
Message-ID:  <Pine.OSF.4.10.10004250959270.13917-100000@yolen.oit.umass.edu>

next in thread | raw e-mail | index | archive | help
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

but this just goes through the whole file echoing stuff. How do I
make it wait for me to type in a value for STATUS.

I'm sure I'm going to discover that the answer is in man sh, but
I haven't found it yet, and I'd like to get the script going to
make an unpleasant task easier. Thanks in advance for pointers.

Greg






To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.10.10004250959270.13917-100000>