Page 1 of 1

Source command not found

Posted: 2018/08/03 13:50:46
by kooder
Hi,

I just got CentOS 6.10 minimal image installed, and ran into an issue as,
[sleo@localhost ~]$ source ~/.bashrc
source: command not found
Below is the sh I was running,
[sleo@localhost ~]$ ls -l `which sh`
lrwxrwxrwx. 1 root root 4 Jul 29 21:55 /bin/sh -> bash
But if I su as root, it can run well.

Any suggestion would be appreciated:)

Re: Source command not found

Posted: 2018/08/03 22:26:37
by toracat
source is a bash built-in command. Are you using bash? Try:

/bin/bash -c 'source ~/.bashrc'

Re: Source command not found

Posted: 2018/08/04 03:52:49
by Whoever
toracat wrote:
2018/08/03 22:26:37
source is a bash built-in command. Are you using bash? Try:

/bin/bash -c 'source ~/.bashrc'
That's probably going to do nothing. Since it runs in a new shell process, any environment settings will be lost when the process finishes.

Re: Source command not found

Posted: 2018/08/04 06:14:23
by toracat
It was meant for testing only. Trying to figure out why the source command does not work.

Re: Source command not found

Posted: 2018/08/05 22:46:20
by Whoever
What does running this command give you:

Code: Select all

ps -p $$