The UNIX and Linux Forums  


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 -->
  #5 (permalink)  
Old 02-10-2009
stanleypane stanleypane is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 23

Code:
set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1`

set i=`cat $LASInputFile | wc -l`
set j=1

while ($j <= $i)

  set line=`cat $LASInputFile | head -$j | tail -1`

  @ j = $j + 1

  # do your thing with $line here.
  # for this example, we'll just echo
  # it back the screen
 
  echo $line

end