cd problem (Re: problem)

mlh at zip.com.au mlh at zip.com.au
Thu Apr 10 07:09:26 EDT 2003


On Thu, 10 Apr 2003 09:40:30 +0530
Molumuri Janardhan <mjanar at corp.untd.com> wrote:

> Why cd command with sudo is not working. Can you help me on these.

You should give more detail and tell us
what you want to do ... but I'll guess ... 
you're doing something like
   sudo cd


This will never "work" because the "current directory"
is something internal to a process.

Sudo does the cd, but when it's finished, your original
process is unchanged.

It should not be even possible to run "sudo cd"
but some posix standardisation genius decided that
all commands should be "exec"able, so there is a 
/bin/cd command which is perfectly useless under
some (most?) versions of commercial Unix.

Luckily the bsd's and linux's do not suffer this
monstrosity.


Regards,
Matt


More information about the sudo-users mailing list