Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CD command with environment variable

51 views
Skip to first unread message

Ben Pfaff

unread,
Feb 4, 2007, 1:11:50 AM2/4/07
to
The documentation for the CD command in release 15 says:

The directory specification can include paths defined in
operating system environment variables.

but it doesn't say how to do that. Any ideas? e.g. are they
specified as $VAR, or %VAR%, or some other way?
--
Ben Pfaff
b...@cs.stanford.edu
http://benpfaff.org

Mike P

unread,
Feb 8, 2007, 12:17:41 PM2/8/07
to
I'm not quite sure what it is your asking, but does this help?

CD 'c:\sales\data\july.sav'.
CD 'c:\sales\data\july'.
CD 'c:\sales\dqta\july'.
If c:\sales\data is a valid directory:

· The first CD command will ignore the filename july.sav and set the
working directory to c:\sales\data.

· If the subdirectory july exists, the second CD command will change
the working directory to c:\sales\data\july; otherwise, it will change
the working directory to c:\sales\data.

· The third CD command will fail if the dqta subdirectory doesn't
exist.


Ben Pfaff

unread,
Feb 8, 2007, 12:25:41 PM2/8/07
to
"Mike P" <michael....@tangozebra.com> writes:

> I'm not quite sure what it is your asking, but does this help?
>
> CD 'c:\sales\data\july.sav'.
> CD 'c:\sales\data\july'.
> CD 'c:\sales\dqta\july'.

No.

Let me restate the question. The documentation for the CD


command in release 15 says:

The directory specification can include paths defined in
operating system environment variables.

I assume that this means that, if the environment contains a
variable named, say, DATADIR, I should be able to CD to it. If
so, then how do I write the command for that. Is it:
CD '%DATADIR%'.
or
CD '$DATADIR'.
(to take a couple of wild guesses) or some other syntax entirely?
The documentation does not say.
--
"The road to hell is paved with convenient shortcuts."
--Peter da Silva

JKPeck

unread,
Feb 8, 2007, 6:02:32 PM2/8/07
to
On Feb 8, 11:25 am, Ben Pfaff <b...@cs.stanford.edu> wrote:


OK. That is because we support platform conventions. But I think
that $DATADIR works everywhere.

JKPeck

unread,
Feb 9, 2007, 8:15:52 AM2/9/07
to

Correction: it is the platform convention only. $ does not work on
Windows.

0 new messages