installing Oracle Instantclient on Linux without setting environment variables?

前端 未结 6 856
别那么骄傲
别那么骄傲 2021-02-10 01:37

Oracle\'s instructions specify setting LD_LIBRARY_PATH. This makes my application dependent on random users\' configuration and is very troublesome to set up.

How can I

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-10 01:57

    You could of course rename sqlplus to sqlplus.real and make a wrapper script:

    #!/bin/sh
    
    if [ "$LD_LIBRARY_PATH" = "" ]
    then
            LD_LIBRARY_PATH=/what/ever
    else
            LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/what/ever
    fi
    
    export LD_LIBRARY_PATH
    
    exec sqlplus.real ${1+"$@"}
    

提交回复
热议问题