tcsh env setting using shell script

Hi All,

I have made a file file usercreate.sh & it has to run in tcsh env & needs some path to be set.

my script is as below.
##########################

#!/bin/csh

setenv PATH "/usr/lib/java/class"

setenv LD_LIBRARAY_PATH 

###########################
but when i am ruuning my script its saying setenv command not found.

Can anyone help me out in this.

Regards

Ankit

Your code calls csh rather than tcsh, though setenv is a built-in in both.

In tcsh the shell maintains a list of variables, each of which whose values can be displayed and changed with
the set and unset commands.

The system maintains its own list of "environment" variables, these can be displayed and changed with printenv, setenv and unsetenv.

So:

~> set PATH=${PATH}:${HOME}/bin
~> echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games:/home/skrynesaver/bin

OR
~> setenv PATH ${PATH}:${HOME}/src/perl
~> printenv PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games:/home/skrynesaver/src/perl