Hi Everyone. I'm having problems with system calls, basically the commands that i can put into my terminal are fine but don't work as system calls from c.
I'm using tcsh.
In other words:
Code:
(23) dino-shill:>setenv W_DIR widthdirectory
(24) dino-shill:>echo $W_DIR
widthdirectory
and in C:
Code:
if(width < 20)
{
printf("cd 2amp/eps/10mto20m\n");
system("setenv W_DIR 2amp/eps/10mto20m");
system("echo $W_DIR");
}
output:
Code:
cd 2amp/eps/3m6to10m
sh: setenv: command not found
Is it because the c program is using sh while i am using tcsh?
How do i tell the program to use tcsh?
Thanks