comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Strange UNIX or strange IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Strange UNIX or strange IDL? [message #13412 is a reply to message #13410] Wed, 04 November 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Harald Frey (hfrey@ssl.berkeley.edu) writes:

> IDL> print,!version
> { sparc sunos unix 5.1 Apr 13 1998}
> IDL> pwd=getenv('PWD')
> IDL> print,pwd
> /disks/sprite/disk1/hfrey/idl/image/wic
> IDL> pwd=getenv('pwd')
> IDL> print,pwd
>
> IDL>
>
> With the name argument of getenv set to capital letters I get the right
> answer, but in small letters 'pwd' returns the null string. However, if
> I use the same command on the UNIX platform I get
>
> image1 [1] pwd
> /disks/sprite/disk1/hfrey/idl/image/wic
> image1 [2] PWD
> PWD: Command not found
>
> and UNIX does not like the capital letter 'PWD'.
>
> Any explanation?

I think you are confusing the command ("pwd"), which in
UNIX (a case sensitive operating system) is always expressed
in lowercase characters, with the environment variable ("PWD")
which is always expressed in uppercase characters. (So
you can tell them apart. :-)

Here IDL is doing exactly the correct thing and getting
the Environment variable for you. When the environment
variable is undefined, you get a null string back.

If you are really just tying to get the current working
directory, here is an IDL program for you:

PRO PWD
CD, Current=thisDirectory
Print, thisDirectory
END

Wouldn't know how to get along without it. :-)

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/

Note: A copy of this article was e-mailed to the original poster.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: random numbers with gamma distribution
Next Topic: Converting characters to real

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 16 21:30:48 PDT 2025

Total time taken to generate the page: 0.80140 seconds