Bug 310 - sudo cd does not work
sudo cd does not work
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-02 18:51 MST by Faheem Mitha
Modified: 2008-11-02 20:08 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Faheem Mitha 2008-11-02 18:51:07 MST
I don't understand the following behavior, which I see on (at least)
Debian lenny as well as Gentoo.

faheem@orwell:~$ sudo cd Mail/
sudo: cd: command not found

This works for pretty much any other command I can think of.
There are two possibilties:

1) This is a bug, which makes me wonder why nobody else has reported
it. it was present in etch and is still present on upgrade to lenny.
I've run into it many times, and finally decided to report it.

2) I'm missing something.

                                                            Faheem.
Comment 1 Todd C. Miller 2008-11-02 20:08:06 MST
From the TROUBLESHOOTING file.

Q) When I try to use "cd" with sudo the command completes without errors but nothing happens.

A) Some operating systems include a /usr/bin/cd command for reasons unfathomable.  A "cd" command is totally useless since a child process cannot affect the current working directory of the parent (your shell).