Hi All,
I did a review of some threads to see if someone had come across this problem.
My system is an oracle virtual box solaris 10 installed on a windows 10 system.
Right now I am learning scripting and am just playing with the env variables.
I am trying to update the PATH to read from the oratab file and use it.
My problem: The result I get is not quite right in the little bash statement I had written. My new exported $PATH is echo'd and a space appears between the root path and the oracle path.
My oratab in /var/opt/oracle/oratab reads the following:
SGCD:/export/home/oracle/app/oracle/product/12.1.0/dbhome_2:N
Since my oracle profile reads ..../dbhome_1 I changed the "1" to a "2" in the oratab file here so as not to get both confused and to see which one is
actually getting copied. I am just learning this bash scripting.
The oracle env path is the following at the env cmd:
PATH=/usr/bin:/bin:/export/home/oracle/app/oracle/product/12.1.0/dbhome_1/b
in and I am using the following command to cut it from the oratab file:
ORACLE_HOME=`cat /var/opt/oracle/oratab|grep -v "^#"|cut -d ':' -f2`
output:
/export/home/oracle/app/oracle/product/12.1.0/dbhome_2
The result I get is not quite right in the little bash statement I had written.
My new exported $PATH ( PATH=/usr/sbin/usr/bin:$ORACLE_HOME/bin
) is echo'd and a space appears between the root path and the oracle path right afterthe colon.
output:
echo $PATH
/usr/bin:/usr/sbin: /export/home/oracle/app/oracle/product/12.1.0/dbhome_2/bin
For the life of me I cannot figure out why this space appears above because it does not allow for other sql commands to be found and executed in my script.
Eventually i will add this to a loop statement to go thru the entire oratab file.
Any help would be appreciated.
Thanks in advance.