Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sh being executed instead of csh

Status
Not open for further replies.

pankajpanjwani

Technical User
Mar 25, 2002
24
0
0
EU
Hi,
I am trying to set some environment variable in my paren shell which are available in a file.

file : test.csh
.....................
source someFilePath/someFile
setenv NEW2 NEW2

...................

test.csh has executable permission, and I am running it on csh.
When I try to execute this file, it gives me a message saying "source: not found" and "setenv: not found"
which means that it is trying to invoke a bourne shell for executing this script.
my attributes in /etc/passwd show that my default shell is /bin/csh.
What I want is that to simply execute the commands and set these variables in parent shell without invoking a new child shell (for which I can use #!/bin/csh)

If you have any clue whats happening here, please let me know, as this is also disturbing me in executing some c-shell functions through tcl, perl & cron scripts.

thanks in advance
Pankaj


 
The default shell for Solaris is bourne shell.
To run a job as a csh make the first line thus: -
#!/usr/bin/csh

or start the job thus: -

csh jobname.csh


Ged Jones

Top man
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top