Daniel Bastos schrieb:
> Is there a way to overcome this? I'd like to run a program that
> changes my current working directory. I don't want to do it through my
> shell's language.
You can /only/ do it through your shell's language.
The current working directory is part of the so-called "environment" of
a process (i.e. a running program) - a collection of various information
that is local to the process; there is exactly one situation where one
process has control over another's environment: A new process will
always start with its environment set to the same values as the process
which started it. Aside from that, no process can tamper with the
environment of another process - so no external program your shell could
possibly start would have the ability to change the shell's working
directory.
You will not find a "cd" command on /any/ Unix machine - it only exists
as a built-in shell command.
(Assuming you're talking about some Unix variant here; but I guess other
multitasking OS will handle the CWD in a similar fashion.)
Post a reply to this message
|