Ubuntu: The setenv command is not found when trying to run a shell script. How do I fix this?


I have a problem with a shell script, which looks like:

#!/bin/csh -f  setenv Test  

The problem is that it worked until I installed Ubuntu 12.04.
The respond tells me that the command setenv is not found.

My idea is that the bash does not change to the csh but how can I fix it?


This happens because the line

#!/bin/csh -f  

is not the very first line in your script file. If it is the first line, then please post the exact error message that is being printed in terminal when you execute the script.

Please verify also that csh/tcsh is actually installed. You can do this by typing the following into terminal:

dpkg -l | grep csh  

If this command produces no output at all, then you can install tcsh by entering following command:

sudo apt-get install tcsh  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »