Page 1 of 1

Need help with script to add entry to my library path

Posted: Wed Nov 21, 2012 9:52 am
by lovabill
Anyone expert here? I have a silly script question as well.

I wrote this line in setlibpath.sh file:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
When I execute
sh ./setlibpath.sh
and then testing it with
echo $LD_LIBRARY_PATH
it doesnt work.

But when I simply run the line in console, it does! Why?
All I want to do, is put the script in the Mint autostart list.

Re: Need help with script to add entry to my library path

Posted: Wed Nov 21, 2012 1:09 pm
by xenopeek
Split from http://forums.linuxmint.com/viewtopic.php?f=90&t=91155 and moved here. See the forum rules; new questions deserve new topics and don't reply to support requests older than six months. Thanks :)

You probably want your setlibpath.sh file to read:

Code: Select all

#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Without that first line it is not a script, and won't be executed. Also make sure you have marked the file to be executable. You can do so with your file manager, or with:

Code: Select all

chmod +x setlibpath.sh
But there is probably a better place to set your LD_LIBRARY_PATH... (Gentle clue for more knowledgeable users to pitch in :))