Can't do: sudo cd /var/cron/tabs
Ladner, Eric (Eric.Ladner)
Eric.Ladner at chevrontexaco.com
Thu Jul 17 08:57:50 EDT 2003
This problem comes up a lot with shell expansion of wild cards through
non-readable directories and shell builtin commands.
A more functional exchange would be (you're original output with some
editing and made up content):
valhalla: /var/cron $ ll
total 1
dr-xr-xr-x 3 root wheel 512 Jul 16 17:26 ./
drwxr-xr-x 24 root wheel 512 Oct 1 2001 ../
-rw------- 1 root wheel 434 Jul 16 17:40 log
-rw------- 1 root wheel 1079 Jul 16 17:00 log.0.gz
-rw------- 1 root wheel 1172 Jul 16 03:00 log.1.gz
-rw------- 1 root wheel 1158 Jul 15 13:00 log.2.gz
-rw------- 1 root wheel 1073 Jul 14 23:00 log.3.gz
drwx------ 2 root wheel 512 Mar 10 16:59 tabs/
valhalla: /var/cron $ cd tabs
ksh: cd: /var/cron/tabs - Permission denied
valhalla: /var/cron $ sudo ls tabs
-rw------- 1 root wheel 434 Jul 16 17:40 stuff
-rw------- 1 root wheel 1079 Jul 16 17:00 junk
-rw------- 1 root wheel 1172 Jul 16 03:00 root
valhalla: /var/cron $ sudo vi tabs/root
Note also that the way sudo and the shell expand wildcards, this doesn't
work since the shell can't expand the wildcard appropriatly.
valhalla: /var/cron $ sudo vi */root
valhalla: /var/cron $ sudo vi tabs/ro* # This won't work either.
Eric
-----Original Message-----
From: sudo-users-bounces at sudo.ws [mailto:sudo-users-bounces at sudo.ws]
Sent: Wednesday, July 16, 2003 17:52
To: sudo-users at sudo.ws
Subject: Can't do: sudo cd /var/cron/tabs
Below you'll see that I'm trying to cd to the /var/cron/tabs directory.
For some reason I cannot do it. I assumed this was because I was not
root. Therefore, I try to use sudo. However, sudo doesn't work with
cd. Can someone help me understand the following:
1. Why can't I cd to the tabs directory?
2. Why will sudo not work with cd?
Your help is appreciated.
rvb
valhalla: /var/cron $ ll
total 1
dr-xr-xr-x 3 root wheel 512 Jul 16 17:26 ./
drwxr-xr-x 24 root wheel 512 Oct 1 2001 ../
-rw------- 1 root wheel 434 Jul 16 17:40 log
-rw------- 1 root wheel 1079 Jul 16 17:00 log.0.gz
-rw------- 1 root wheel 1172 Jul 16 03:00 log.1.gz
-rw------- 1 root wheel 1158 Jul 15 13:00 log.2.gz
-rw------- 1 root wheel 1073 Jul 14 23:00 log.3.gz
drwx------ 2 root wheel 512 Mar 10 16:59 tabs/
valhalla: /var/cron $ cd tabs
ksh: cd: /var/cron/tabs - Permission denied
valhalla: /var/cron $ sudo cd tabs
sudo: cd: command not found
valhalla: /var/cron $
____________________________________________________________
sudo-users mailing list <sudo-users at sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users
More information about the sudo-users
mailing list