Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2000 08:45:39 -0700
From:      Ryan Davis <ryand@zenspider.com>
To:        Greg Pavelcak <gpav@som.umass.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re:Making sh script pause for input
Message-ID:  <p04310101b52b6d60f1b1@[216.39.164.68]>
In-Reply-To: <Pine.OSF.4.10.10004250959270.13917-100000@yolen.oit.umass.edu>
References:  <Pine.OSF.4.10.10004250959270.13917-100000@yolen.oit.umass.edu>

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




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