Re: IDL environment [message #42105] |
Thu, 30 December 2004 12:48  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Mon, 27 Dec 2004 20:39:39 -0800, judy wrote:
> I am a newbe to IDL and looking for information for setting up the
> environment. I did create the ~/idl_startup.pro file to set the
> graphics to true_color=24, also added a directory to the path. I would
> also like to change the idl prompt from something like,
>
> /home/judy/idl>
>
> and have the prompt update to always display the current working
> directory. I have experimented with the !prompt variable, could
> probably create a alias cd.pro program to update the variable every
> time the directory changes, just thought I would ask this group first.
This type of changing prompt won't work well with IDLWAVE, unless you
carefully set the prompt matching expression to something which
matches all prompt, but does not match other random output.
JD
|
|
|
Re: IDL environment [message #42116 is a reply to message #42105] |
Wed, 29 December 2004 02:35   |
judy
Messages: 4 Registered: December 2004
|
Junior Member |
|
|
Thanks for the suggestions. Here is what I am current using, need to
format the output from systime(), the prompt is too long this way.
PRO cdd, dir1
cd, dir1
!prompt = systime() + ' ' + dir1 + ' > '
END
Judy
Michael Wallace wrote:
>> PRO PWD
>> CD, Current=thisDir
>> PRINT, thisDir
>> END
>
> Maybe I'm missing something, which I usually do, but wouldn't you
just
> need a single command?
>
> IDL> $pwd
> /the/current/working/directory
>
> I use the shell escape ($) when I need to do something quick with
the
> file system. I use $ls, $pwd and $vi (!!) all the time it seems. Of
> course, this is only useful for ad hoc IDL from the prompt, but that
is
> what the original poster was asking about, no?
>
> -Mike
|
|
|
|
Re: IDL environment [message #42124 is a reply to message #42123] |
Tue, 28 December 2004 08:02   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Michael Wallace writes:
> Maybe I'm missing something, which I usually do, but wouldn't you just
> need a single command?
>
> IDL> $pwd
> /the/current/working/directory
>
> I use the shell escape ($) when I need to do something quick with the
> file system. I use $ls, $pwd and $vi (!!) all the time it seems. Of
> course, this is only useful for ad hoc IDL from the prompt, but that is
> what the original poster was asking about, no?
Well, of course, this saves that extra $ character, which adds
up over the course of an IDL lifetime. But it also works on
those annoying Windows machines that some of us use. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
|
Re: IDL environment [message #42127 is a reply to message #42126] |
Mon, 27 December 2004 21:23   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
judy writes:
> I am a newbe to IDL and looking for information for setting up the
> environment. I did create the ~/idl_startup.pro file to set the
> graphics to true_color=24, also added a directory to the path. I would
> also like to change the idl prompt from something like,
>
> /home/judy/idl>
>
> and have the prompt update to always display the current working
> directory. I have experimented with the !prompt variable, could
> probably create a alias cd.pro program to update the variable every
> time the directory changes, just thought I would ask this group first.
>
> I am currently using,
>
> IDL = Student Edition 6.0.3 (linux x86 m32)
> OS = SuSE 9.0
> Shell= tcsh
I don't think there is any way to change the prompt
like this in a reliable way. You could write your
own "mycd.pro", which called the IDL CD program
and changed the prompt appropriately. And as long
as you only run programs you write, and as long
as you use MYCD instead of CD you will be fine.
But it is hard to live in such isolation. If it
were me, I'd leave the prompt alone and work up
a nice PWD program so you can always find out
what directory you are in when you need to know. :-)
Cheers,
David
P.S. Oh, what the hell, Merry Christmas!
PRO PWD
CD, Current=thisDir
PRINT, thisDir
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: IDL environment [message #42197 is a reply to message #42125] |
Tue, 04 January 2005 11:14  |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
Michael Wallace wrote:
>> PRO PWD
>> CD, Current=thisDir
>> PRINT, thisDir
>> END
>
>
> Maybe I'm missing something, which I usually do, but wouldn't you just
> need a single command?
>
> IDL> $pwd
> /the/current/working/directory
>
> I use the shell escape ($) when I need to do something quick with the
> file system. I use $ls, $pwd and $vi (!!) all the time it seems. Of
> course, this is only useful for ad hoc IDL from the prompt, but that is
> what the original poster was asking about, no?
>
> -Mike
I think $pwd will tell you the directory from which you started your IDL
session. If you did a 'cd /some/where' later in IDL, $pwd won't tell you
the current IDL working directory.
Benjamin
|
|
|