If there are no errors, than how can you tell that the code isn't working?
The exported $LD_LIBRARY_PATH only applies to:
-programs started after the export command (in the script that contains the export command)
-programs started from scripts that "source" (ie include) the script that contains the export command.
Running for instance:
as a separate script (ie calling "myscript.sh") will execute the export command. But since there are no other programs called after the export, it will have no effect.
Once the script stops, the changed $LD_LIBRARY_PATH variable is lost as well, since it was part of the script's environment, not the environment of the shell that calls the script.
If you want to have the changed LD_LIBRARY_PATH in the parent shell, you need to "source" script.sh rather than execute it.
This is done by:
After that, you'll see that your $LD_LIBRARY_PATH has changed.