/usr/libexec/grepconf.sh: line 5: grep: command not found

Cause:

When source profile or bash profile make sure proper PATH variable is set

[root@ip-172-31-50-177 java]# source /etc/profile
/usr/libexec/grepconf.sh: line 5: grep: command not found

The following error land when you source bash profile with improper path to executable libraries

export JAVA_HOME=/usr/java/jdk1.8.0_161/
export JRE_HOME=/usr/java/jdk1.8.0_161/jre/
export PATH=$JAVA_HOME/bin:$PATH  <=================

Workaround:

Set the correct path to the executables directory

export PATH=$JAVA_HOME/bin:/usr/local/bin:/usr/bin:$PATH

[root@ip-172-31-50-177 java]# source /etc/profile                             
[root@ip-172-31-50-177 java]# 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s