View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

source irafuser.csh leads to undefined variable Unbuntu

Khary Richardson wrote on Jun 23, 2011

Hi all. I am new to unix as well as IRAF so please bear with me. I was following the directions for Unbuntu install found here

http://geco.phys.columbia.edu/~rubab/iraf/iraf_step_by_step_installation

everything was going fine until I got this step.

cd /iraf/iraf/unix/hlib

source irafuser.csh


I changed directories and typed

source irafuser.csh


which gave this error message

iraf: Undefined variable.


I tried typing the full path name after source and got the same message. I then tried
sudo /home/iraf/unix/hlib/irafuser.csh


and got a : command not found error. Can someone explain to me where I am going wrong.
thank you

Mike Fitzpatrick wrote on Jun 23, 2011

Try doing a

setenv iraf /iraf/iraf/


(trailing '/' is required) before the source command. To simply use iraf you don't need to do either of these steps, they are mostly needed for development or e.g. to build external packages. I think your 'sudo' command is failing because you used the /home/iraf path instead of /iraf/iraf

Khary Richardson wrote on Jun 23, 2011

Fitz

I tried
 /source irafuser.csh 
as well as

 ./source irafuser.csh


as well as what you suggested. When I did the setenv nothing happened at all, and I got the error messages when I retried source.

I am using /home/iraf/ because earlier in the install when I tried

sudo chown -R iraf:iraf /iraf


I got

chown: cannot access `/iraf': No such file or directory


but
 sudo chown -R iraf:iraf /home/iraf


worked

Khary Richardson wrote on Jun 23, 2011

I just looked at the setting under users and groups, and it looks like I set /home/iraf as the iraf home directory.

Mike Fitzpatrick wrote on Jun 23, 2011

If /home/iraf is where you actually unpacked the files then that is what you should use. 'source' is a C-shell command and is used to load the definitions in the irafuser.csh file, however this presumes that you are using a C-shell at the time and not a Bash shell. If this is the problem, type 'csh' before running the source/setenv commands.

Khary Richardson wrote on Jun 23, 2011

I will give it a try. How can one tell if it is a C-shell or Bash shell? Thanks

Mike Fitzpatrick wrote on Jun 23, 2011

Try "echo $SHELL" Or, if you get lots of errors or a 'command not found' message from doing the 'source' then you're probably in a Bash shell.

Khary Richardson wrote on Jun 23, 2011

nothing seems to be happening. this is what I typed


ubuntu:~/unix/hlib> csh
ubuntu:~/unix/hlib> source irafuser.csh
ubuntu:~/unix/hlib>


then tried

ubuntu:~/unix/hlib> source /home/iraf/unix/hlib/irafuser.csh
ubuntu:~/unix/hlib> 

Mike Fitzpatrick wrote on Jun 23, 2011

That's all normal -- there is no output, all it does is define some environment variables. Like I said, its not needed for simply using the system by most users.

Khary Richardson wrote on Jun 23, 2011

fitz

Try "echo $SHELL" Or, if you get lots of errors or a 'command not found' message from doing the 'source' then you're probably in a Bash shell.


I got

/bin/tcsh

which I now remember is what the instructions I am following said to set it as

Khary Richardson wrote on Jun 23, 2011

fitz

That's all normal -- there is no output, all it does is define some environment variables. Like I said, its not needed for simply using the system by most users.


okay thank you.

Khary Richardson wrote on Jun 23, 2011

It says that the script must be run as root for changes to take effect. To do that I just type

root ./install


correct?

Khary Richardson wrote on Jun 23, 2011

never mind remembered what to do

Last post on Jun 23, 2011