<< terminator not found error

I am using the following script. I am basically trying to enter data to my database using a storeprocedure.

PFB MY script.

#!/bin/csh -f
foreach FF (`cat ADDUSERS`)
isql -VENKIDB -U gloss -P glosss << _endl
set nocount on
go
use VENKI_PROD
go
print "Adding the user to GSTB Institutional for User : $FF"
go
sp_addlogin '$FF', '1$FF'
go
_end1
end

The script basically takes values from another file which is passing the values one by one as a parameter.

However when I try execute the above script it fails at second line with the below error.

_endl: << terminator not found

I tried various options and could get it corrected. Can someone help in finding out , what exactly I am missing.

Thanks in advance for your help.

use KSH or BASH

Mine is a /bin/csh - cshell..

yes.. change it to ksh or sh or bash

 
#!/bin/ksh
or
#!/bin/sh
or
#!/bin/bash

Is this not compatible with cshell? If not it would be great if you let me know on what exactly is the reason.

---------- Post updated at 01:25 PM ---------- Previous update was at 01:17 PM ----------

I actually have another script which has the same snipped for connecting. It also connects through csh shell only. Also I dont get any error for the same.

however when I have just copied the connection line from the other script , I get this error when trying to execute the same in the new one. I am not sure on the type of the error.

let me know if you need the other script for your reference.

make sure there are no spaces after _endl
why not csh
http://www.grymoire.com/Unix/CshTop10.txt
Csh Programming Considered Harmful
Re: [Q] FTp batch job under "csh" error?
[Q] batch FTP program under CSH error ?? - comp.unix.admin | Computer Group

It's hard to tell for sure but it looks like one is end-one and the other is end-lower-case-ell. Make sure they really match.