/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]#