Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!ditka!teda!jeffy From: jeffy@teda.UUCP (Jeffrey Youngstrom) Newsgroups: comp.unix.shell Subject: read from a file in bourne shell Message-ID: <20994@teda.UUCP> Date: 19 Feb 91 22:35:22 GMT Sender: news@ditka.chicago.com (Pulitzer at ditka) Lines: 32 I want to set some variables in a Bourne shell script from the contents of a file while still being able to prompt a real time user for input. The file looks like this: 1 0 foo 8 2 (i.e. one word per line) Things I've tried: spawning a subshell and redirecting its input from the file. But variables not available outside the subshell, and can't get user input from inside the subshell. hokey kludges using "for var in `cat file`" and/or awk But ugly. (so to speak... :-) Is there a good way to set variables from file contents in Bourne? As far as I can tell, Bourne doesn't support arrays? Please send email. I'll summarize for interested parties (email me) Thanks, jeffy -- Jeffrey Youngstrom ...!{decwrl,sun}!teda!jeffy or jeffy@altair.csustan.edu Teradyne EDA West | 5155 Old Ironsides Drive | Santa Clara, CA 95054 I have no idea what I'm doing out of bed.