read

Ok everyone, here is my script that won't work on my Sun Sparc2
SunOS 4.1.3 (a small portion of it):

# this program converts RainForm Gold format into grass
#
#!/bin/sh

echo "This program converts Rainform Gold data into"
echo "Grass binary data"

echo "Enter the name of the file to be converted: "
read infile

echo "Enter the resultant filename: "
read outfile

v.in.rform $infile $outfile

Now I know this should work and you guys know it should work but
when I run it I get the following errors:

This program converts Rainform Gold data into
Grass binary data
Enter the name of the file to be converted:
read: Command not found.
Enter the resultant filename:
read: Command not found.
infile: Undefined variable.

Now here is how my programmer changed the program and notice the
not so subtle changes:

# this program converts RainForm Gold format into grass
#
#!/bin/csh

echo -n "This program converts Rainform Gold data into"
echo -n "Grass binary data"

echo -n "Enter the name of the file to be converted: "
set infile=$<

echo -n "Enter the resultant filename: "
set outfile=$<

v.in.rform $infile $outfile

This works fine. What is happening here?

Jim
jim@sar_ws.fb4.noaa.gov

P.S. Thanks for everyones help and interest in this problem!!

The statement

#!/bin/sh

has to be the FIRST line in the script!!!

Ronald Wiemer