The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-10-2009
phudgens phudgens is offline
Registered User
  
 

Join Date: Feb 2009
Location: Denver
Posts: 40
Read text file in Cshell

I've been searching the forums for info on reading a text file in a Cshell script but nothing I'm trying is working. My latest attempt was:

set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1`
echo $LASInputFile
while read line
do
echo $line
done < $LASInputFile


My error message is: while: Expression syntax

Thanks for any help

Paul Hudgens
Denver