$ source /etc/environment
$ sudo source /etc/environment
[sudo] password for t:
sudo: source: command not found
It seems that a different shell than bash
is run to execute source /etc/environment
and that shell doesn't have source
as builtin.
But my and the root's default shells are both bash
.
$ echo $SHELL
/bin/bash
If sudo
indeeds uses a different shell, why is it? I saw slm's reply, but don't understand in my case.
source
is a shell builtin..you can not usesudo
to run a shell builtin like an external command.. – heemayl May 08 '15 at 22:12