Welcome to iraf.net Thursday, April 25 2024 @ 12:00 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Starting IRAF
   
ircarrascal
 01/22/2016 06:58PM (Read 1775 times)  
+----
Newbie

Status: offline


Registered: 08/01/2014
Posts: 7
I did an mkiraf inside /home/ivan/IRAF and then a script like this:

cd ~/IRAF
xgterm -sb -title "Image Reduction and Analysis Facility (IRAF)" -e "ecl" &

which I saved in my bin directory as "iraf" so that when I type "iraf" in the terminal (not after starting ecl), it opens up an xgterm with IRAF ready to go. The problem is that then the working directory is /home/ivan/IRAF and not the directory from which "iraf" was called in the terminal. Is there a way to make my "iraf" script above launch the IRAF from /home/ivan/IRAF, but then change directory to the working directory?

I hope this question makes sense!

 
Profile Email
 Quote
Sergei Schmalz
 01/23/2016 08:59AM  
+----
Newbie

Status: offline


Registered: 01/17/2016
Posts: 2
Hello Ivan!

I think this is more of a Linux usage question than IRAF.

You may try this method:
http://stackoverflow.com/questions/786376/how-do-i-run-a-program-with-a-different-working-directory-from-current-from-lin

I am not absolutely sure, but I guess your script will be:
(cd . )

The dot '.' means in Linux your 'current working directory'. But then you will have to delete 'cd ~/IRAF' in your script and invoke xgterm with a full path-name. Just try it.

 
Profile Email
 Quote
fitz
 01/25/2016 04:27PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Sergei's answer is essentially correct, i.e. something like

% xgterm -e "(chdir /tmp ; cl)"

would start IRAF and put you in the /tmp directory. But your script has a "cd ~/IRAF" before the call to xgterm so your working directory has effectively been changed and the script is doing what you told it to.

If you're using the 'cd' command because your login.cl is in ~/IRAF then you should know that with v2.16 you have a "personal install" (i.e. just run the $iraf/install script as yourself) that creates a global login.cl in your $HOME/.iraf directory and allows you to type 'cl' (or "xgterm -e cl") from any directory and the CL environment stays in that directory. If there happens to be a login.cl/loginuser.cl in the current dir then that will be used, but the effect is to allow you to type CL from anywhere and not *require* a login.cl.

 
Profile Email
 Quote
ircarrascal
 01/27/2016 03:50PM  
+----
Newbie

Status: offline


Registered: 08/01/2014
Posts: 7
Fantastic! I did the personal install, so my script is in fact not needed with v2.16. Thank you!

 
Profile Email
 Quote
   
Content generated in: 0.17 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login