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 -->
  #3 (permalink)  
Old 02-07-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Quote:
Originally Posted by nabmufti View Post
while read line $var
I don't think read works this way.
Try:

Code:
cat $var | while read line

It appears from your error that you are inadvertantly executing the lines of the file rather than just reading them. Post your full script (use CODE and /CODE tags carefully to make it easier to read) and we'll take a look.