[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sudo and shell builtins



I was experimenting with avoiding 'su' for system maintenance stuff,
using sudo instead.  This was going fine until I decided to take a peek
at my exim log:

$ cd /var/log
$ cd exim
bash: cd: exim: Permission denied
$ sudo cd exim
sudo: cd: command not found

Well, it makes sense:  'cd' isn't in the path, it's a shell builtin.  Of
course, I can do 'sudo -s', but that kind of defeats the purpose of
using sudo instead of just opening a root shell in the first place.
(Naturally, I could 'sudo tail /var/log/exim/mainlog' too, but sometimes
one likes to root around in a directory.)

In short, is there a way to execute a shell builtin as root using
something like sudo, or must I always open a root shell to use 'cd' or
similar?

-- 
Thanasis Kinias
Web Developer, Information Technology
Graduate Student, Department of History
Arizona State University
Tempe, Arizona, U.S.A.

Ash nazg durbatul�k, ash nazg gimbatul,
Ash nazg thrakatul�k agh burzum-ishi krimpatul



Reply to: