logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Unset?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
Calvinthesneak



Joined: 15 Nov 2010
Posts: 14

PostPosted: Wed Jan 19, 2011 8:08    Post subject: Unset? Reply with quote

I'm curious what is the purpose of the unset command that I see in a lot of the nwnstartup.sh files?

Quote:

unset LD_PRELOAD
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Wed Jan 19, 2011 14:59    Post subject: Reply with quote

Removes the environment variable from the shell environment ... that sounds a bit weird.

Say if you have an environment variable:

Code:
MYVAR=fred


you can either set it to nothing

Code:
MYVAR=


but it will still appear in a list of environment variables like when using 'env' but without a value assigned or you can remove it altogether:

Code:
unset MYVAR


and it doesn't appear in the list. Never tried to see if it makes any difference to the dynamic loader if LD_PRELOAD is set to nothing, pretty sure it doesn't.


You use it to remove the nwnx2.so hook functions from attempting to be used on a non-nwnserver binary. You can also do the same by setting the LD_PRELOAD for that specific command only by prefixing the command with the variable such as:

Code:
LD_PRELOAD=/path/to/nwnx/nwnx2.so /path/to/nwn/nwserver


that way you can do all sorts of other things without any problems, either or method works fine as long as you know what it is doing.
_________________
oops
Back to top
View user's profile Send private message
Calvinthesneak



Joined: 15 Nov 2010
Posts: 14

PostPosted: Wed Jan 19, 2011 17:35    Post subject: Reply with quote

Thanks Paul. I'm getting decent with Linux, but still a few little things that escape me from time to time. I'd read the man page to know what it did, but that doesn't always explain the why very well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group