Welcome to iraf.net Saturday, May 11 2024 @ 02:05 PM GMT
ircarrascal |
01/22/2016 06:58PM (Read 1785 times)
|
|
|
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!
|
|
|
|
Sergei Schmalz |
01/23/2016 08:59AM
|
|
|
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.
|
|
|
|
fitz |
01/25/2016 04:27PM
|
|
|
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.
|
|
|
|
ircarrascal |
01/27/2016 03:50PM
|
|
|
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!
|
|
|
|
| |
|
Content generated in: 0.09 seconds |
|