Need help with script to add entry to my library path

Forum rules
Before you post please read how to get help
lovabill
Level 1
Level 1
Posts: 1
Joined: Thu Dec 01, 2011 8:45 pm

Need help with script to add entry to my library path

Postby lovabill » Wed Nov 21, 2012 9:52 am

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.

User avatar
xenopeek
Level 23
Level 23
Posts: 19031
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

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

Postby xenopeek » Wed Nov 21, 2012 1:09 pm

Split from 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 :))
Image


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 0 guests