sh: error importing function definition for BASH_FUNC_module in linux

In this post, we will resolve error importing function definition for ‘BASH_FUNC_module‘.

Error:
 
sh: module: line 1: syntax error: unexpected end of file
 
sh: error importing function definition for ‘BASH_FUNC_module
 
or
 
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module’
 
 

Steps to fix error importing function definition for `BASH_FUNC_module’ in linux.

 
 
 
This is related to OS level profiles setup referencing modules.sh.
 
 
This issue may occur when doing any of the following:
 
 
1. Attempting to start the Admin Server:
 
    $ sh adadminsrvctl.sh start
 
 
2. Running either adop prepare or apply phases:
 
$ adop phase=prepare or adop phase=apply   
 
 
 
To implement the solution, test the following steps in a Test or Development instance and migrate on production accordingly: –
 
 
1. Please rename the /etc/profile.d/modules.sh to /etc/profile.d/modules.sh.bkup h.
 
Connect as root and check the shell file modules.sh under ‘/etc/profile.d’:
 
#ls -ltr /etc/profile.d/modules.sh
 
 

 

-rw-rw-r–. 1 root root 168 Mar 25  2014 /etc/profile.d/modules.sh

 

 
 
# mv /etc/profile.d/modules.sh /etc/profile.d/modules.sh.bkup
 
 
 
2. Run ./adadminsrvctl.sh start to test whether the issue (sh: module: line 1: syntax error: unexpected end of file) is resolved.
 
 
After doing the above steps, hope this will fix the errorbash: syntax error near unexpected token‘.
 
 
 

Leave a Comment