Source command not found

General support questions
Post Reply
kooder
Posts: 5
Joined: 2018/07/29 10:01:16

Source command not found

Post by kooder » 2018/08/03 13:50:46

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:)

User avatar
toracat
Forum Moderator
Posts: 7307
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Source command not found

Post by toracat » 2018/08/03 22:26:37

source is a bash built-in command. Are you using bash? Try:

/bin/bash -c 'source ~/.bashrc'
CentOS Forum FAQ

Whoever
Posts: 1040
Joined: 2013/09/06 03:12:10

Re: Source command not found

Post by Whoever » 2018/08/04 03:52:49

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.

User avatar
toracat
Forum Moderator
Posts: 7307
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Source command not found

Post by toracat » 2018/08/04 06:14:23

It was meant for testing only. Trying to figure out why the source command does not work.
CentOS Forum FAQ

Whoever
Posts: 1040
Joined: 2013/09/06 03:12:10

Re: Source command not found

Post by Whoever » 2018/08/05 22:46:20

What does running this command give you:

Code: Select all

ps -p $$

Post Reply